added Exceptions
This commit is contained in:
parent
8eb867a971
commit
ec4e6c5df7
@ -87,13 +87,13 @@ class Host(models.Model):
|
|||||||
def getIPv4(self):
|
def getIPv4(self):
|
||||||
try:
|
try:
|
||||||
return dnstools.query_ns(self.get_fqdn(), 'A')
|
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 ''
|
return ''
|
||||||
|
|
||||||
def getIPv6(self):
|
def getIPv6(self):
|
||||||
try:
|
try:
|
||||||
return dnstools.query_ns(self.get_fqdn(), 'AAAA')
|
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 ''
|
return ''
|
||||||
|
|
||||||
def poke(self):
|
def poke(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user