work around UnknownTSIGKey exception blowing up the overview view
This commit is contained in:
parent
a70e9d01c5
commit
92c105b64c
@ -28,6 +28,7 @@ import random
|
||||
import struct
|
||||
|
||||
import dns.inet
|
||||
import dns.message
|
||||
import dns.name
|
||||
import dns.resolver
|
||||
import dns.query
|
||||
@ -256,7 +257,7 @@ def query_ns(fqdn, rdtype, prefer_primary=False):
|
||||
ip = str(list(answer)[0])
|
||||
logger.debug("query: %s answer: %s" % (fqdn, ip))
|
||||
return ip
|
||||
except (dns.resolver.Timeout, dns.resolver.NoNameservers) as e: # socket.error also?
|
||||
except (dns.resolver.Timeout, dns.resolver.NoNameservers, dns.message.UnknownTSIGKey) as e: # socket.error also?
|
||||
logger.warning("error when querying for name '%s' in zone '%s' with rdtype '%s' [%s]." % (
|
||||
fqdn.host, origin, rdtype, str(e)))
|
||||
set_ns_availability(origin, False)
|
||||
|
@ -7,6 +7,7 @@ import time
|
||||
import base64
|
||||
|
||||
import dns.resolver
|
||||
import dns.message
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.auth import get_user_model
|
||||
@ -288,7 +289,8 @@ class Host(models.Model):
|
||||
return dnstools.query_ns(self.get_fqdn(), record)
|
||||
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
|
||||
return None
|
||||
except (dns.resolver.NoNameservers, dns.resolver.Timeout, dnstools.NameServerNotAvailable):
|
||||
except (dns.resolver.NoNameservers, dns.resolver.Timeout, dnstools.NameServerNotAvailable,
|
||||
dns.message.UnknownTSIGKey):
|
||||
return _('error')
|
||||
|
||||
def get_ipv4(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user