Am 15.06.2012 um 13:23 schrieb James Raftery:
> On Fri, Jun 15, 2012 at 11:33:31AM +0200, Axel Rau wrote:
>> zone = dns.zone.from_xfr(dns.query.xfr(s, self.name, relativize=False,
>> lifetime=30.0), relativize=False)
>> my_covers = dns.rdatatype.DNSKEY # DNSKEYs signed by KSK
>> rds = zone.find_rrset(self.name + '.', 'RRSIG', covers=my_covers)
>>
>> for rrsig_rdata in rds.items:
>> key_tag = rrsig_rdata.key_tag
>>
>>
>> ...gives: <class 'dns.exception.FormError'>
>
> On which line? What is the exception text?
---
I need to improve my exception handler, to get usefull info:
---
except (dns.exception.FormError):
(exc_type, exc_value, exc_traceback) = sys.exc_info()
errmsg = "%s: RRSIG query Format error: (FormError). %s, %s" % \
(self.name, exc_type, exc_value)
l.logError(errmsg)
e = misc.AbortedZone('? ' + errmsg)
raise e
---
>
> You can get a FormError exception from dns.query.xfr() if the server replies
> with no resource records (indicating it rejected your AXFR request).
>
> I've just encountered exactly this behaviour. I think the conditional in
> query.py needs to be separated so distinct exceptions are raised for 'no
> answer' and 'bogus answer':
>
> if not r.answer or r.answer[0].name != oname:
> raise dns.exception.FormError("No answer or RRset not for qname")
I will try that.
Axel
---
PGP-Key:29E99DD6 ☀ +49 151 2300 9283 ☀ computing @ chaos claudius
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo/dnspython-users