catch socket.error (e.g. "connection refused"), fixes #195

This commit is contained in:
Thomas Waldmann 2015-01-09 21:46:30 +01:00
parent 795170e2b9
commit 0d8f6cc82e

View File

@ -325,6 +325,10 @@ def update_ns(fqdn, rdtype='A', ipaddr=None, action='upd', ttl=60):
rcode_text, action, name, origin, rdtype, ipaddr))
raise DnsUpdateError(rcode_text)
return response
except socket.error as e:
logger.error("socket.error [%s] - zone: %s" % (str(e), origin, ))
set_ns_availability(domain, False)
raise DnsUpdateError("SocketError %d" % e.errno)
except dns.exception.Timeout:
logger.warning("timeout when performing %s for name %s and origin %s with rdtype %s and ipaddr %s" % (
action, name, origin, rdtype, ipaddr))