added Exceptions

This commit is contained in:
Fabian Faessler 2013-09-30 01:40:31 +02:00
parent 8eb867a971
commit ec4e6c5df7

View File

@ -87,13 +87,13 @@ class Host(models.Model):
def getIPv4(self):
try:
return dnstools.query_ns(self.get_fqdn(), 'A')
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers):
return ''
def getIPv6(self):
try:
return dnstools.query_ns(self.get_fqdn(), 'AAAA')
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers):
return ''
def poke(self):