diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-13 10:43:40 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-13 10:43:40 -0400 |
commit | ae0f94c8f39a234d73ab8e2caf24d73439c8b5ee (patch) | |
tree | 1e22394262bff28204d984607536c3582d30e00a /cloudinit/util.py | |
parent | fd938d20c62320c9068a9f517ccc465f561e7499 (diff) | |
download | vyos-cloud-init-ae0f94c8f39a234d73ab8e2caf24d73439c8b5ee.tar.gz vyos-cloud-init-ae0f94c8f39a234d73ab8e2caf24d73439c8b5ee.zip |
fix / workaround potential for socket.getaddrinfo to raise socket.error
As reported in bug 1154599, I'm seeing this on my desktop system:
$ python -c \
'from cloudinit import util; print util.is_resolvable("brickies.neiit")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "cloudinit/util.py", line 865, in is_resolvable
socket.SOCK_STREAM, socket.AI_CANONNAME)
LP: #1154599
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index a1f6e004..10297ca2 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -867,7 +867,7 @@ def is_resolvable(name): for (_fam, _stype, _proto, cname, sockaddr) in result: badresults[iname].append("%s: %s" % (cname, sockaddr[0])) badips.add(sockaddr[0]) - except socket.gaierror: + except (socket.gaierror, socket.error): pass _DNS_REDIRECT_IP = badips if badresults: @@ -880,7 +880,7 @@ def is_resolvable(name): if addr in _DNS_REDIRECT_IP: return False return True - except socket.gaierror: + except (socket.gaierror, socket.error): return False |