Print better information when AXFR fails

This commit is contained in:
Joshua Boniface 2018-11-27 22:18:59 -05:00
parent a270770ec2
commit 1da98a4497
1 changed files with 3 additions and 2 deletions

View File

@ -288,10 +288,11 @@ class AXFRDaemonInstance(object):
# Get an AXFR from the dnsmasq instance and list of records
try:
z = dns.zone.from_xfr(dns.query.xfr(dnsmasq_ip, domain, lifetime=5.0))
axfr = dns.query.xfr(dnsmasq_ip, domain, lifetime=5.0)
z = dns.zone.from_xfr(axfr)
records_raw = [z[n].to_text(n) for n in z.nodes.keys()]
except OSError as e:
print('{} ({})'.format(e, domain))
print('{} {} ({})'.format(e, dnsmasq_ip, domain))
continue
# Fix the formatting because it's useless