Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 8140ae8

Browse files
glance-balloob
authored andcommitted
Return host on ip convertion error (#57)
This works around issue #46. Signed-off-by: Anton Lundin <glance@acc.umu.se>
1 parent 5861577 commit 8140ae8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netdisco/discoverables/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ def ip_from_host(self, host):
105105
"""
106106
ips = self.netdis.mdns.zeroconf.cache.entries_with_name(host.lower())
107107

108-
return repr(ips[0]) if ips else host
108+
try:
109+
return repr(ips[0]) if ips else host
110+
except TypeError:
111+
return host
109112

110113

111114
class GDMDiscoverable(BaseDiscoverable):

0 commit comments

Comments
 (0)