If we can't resolve compute name return 0.0.0.0

It's not perfect, but it's rare in most cases it's
handle before.

Fix #892
This commit is contained in:
Julien Duponchelle committed 2017-02-06 16:47:40 +01:00
1 parent 9c7d2e9915
commit 08c2892295
1 file changed
+4 -1
+4 -1
View File
@@ -214,7 +214,10 @@ class Compute:
"""
Return the IP associated to the host
"""
return socket.gethostbyname(self._host)
try:
return socket.gethostbyname(self._host)
except socket.gaierror:
return '0.0.0.0'
@host.setter
def host(self, host):