update_ns: catch UnknownTSIGKey exception

This commit is contained in:
Thomas Waldmann 2014-07-14 21:48:10 +02:00
parent fdc63a20a9
commit 480dbd358c

View File

@ -315,6 +315,10 @@ def update_ns(fqdn, rdtype='A', ipaddr=None, origin=None, action='upd', ttl=60):
logger.error("PeerBadSignature - shared secret mismatch? zone: %s" % (origin, )) logger.error("PeerBadSignature - shared secret mismatch? zone: %s" % (origin, ))
set_ns_availability(domain, False) set_ns_availability(domain, False)
raise DnsUpdateError("PeerBadSignature") raise DnsUpdateError("PeerBadSignature")
except dns.message.UnknownTSIGKey as e:
logger.error("UnknownTSIGKey [%s] - zone: %s" % (str(e), origin, ))
set_ns_availability(domain, False)
raise DnsUpdateError("UnknownTSIGKey")
def set_ns_availability(domain, available): def set_ns_availability(domain, available):