DOC: Revert dnsToIp error change, seperate log message for socket.error

pull/171/head
Steven Hiscocks 2013-04-15 20:44:13 +01:00
parent 88187fc161
commit a8f2e02eea
1 changed files with 5 additions and 1 deletions

View File

@ -664,10 +664,14 @@ class DNSUtils:
""" """
try: try:
return socket.gethostbyname_ex(dns)[2] return socket.gethostbyname_ex(dns)[2]
except socket.error: except socket.gaierror:
logSys.warn("Unable to find a corresponding IP address for %s" logSys.warn("Unable to find a corresponding IP address for %s"
% dns) % dns)
return list() return list()
except socket.error, e:
logSys.warn("Socket error raised trying to resolve hostname %s: %s"
% (dns, e))
return list()
dnsToIp = staticmethod(dnsToIp) dnsToIp = staticmethod(dnsToIp)
#@staticmethod #@staticmethod