From 400259c758f9e3be418828132f378237703dea80 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 22 Jan 2014 14:03:36 +0100 Subject: [PATCH] get_ip: if there is no A/AAAA record, anwer "none" (anwer "error" only in real error cases) --- nsupdate/main/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nsupdate/main/models.py b/nsupdate/main/models.py index f7590a2..040c722 100644 --- a/nsupdate/main/models.py +++ b/nsupdate/main/models.py @@ -202,8 +202,9 @@ class Host(models.Model): record = 'A' if kind == 'ipv4' else 'AAAA' try: return dnstools.query_ns(self.get_fqdn(), record, origin=self.domain.domain) - except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers, dns.resolver.Timeout, - dnstools.NameServerNotAvailable): + except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer): + return 'none' + except (dns.resolver.NoNameservers, dns.resolver.Timeout, dnstools.NameServerNotAvailable): return 'error' def get_ipv4(self):