Properly checking response code from update
This commit is contained in:
parent
2a284f7d80
commit
0278fad2fe
|
@ -14,6 +14,7 @@ from dns.name import Name
|
|||
from dns.name import from_text as name_from_text
|
||||
from dns.nameserver import Do53Nameserver
|
||||
from dns.query import tcp
|
||||
from dns.rcode import Rcode
|
||||
from dns.rdataclass import RdataClass
|
||||
from dns.rdataset import Rdataset
|
||||
from dns.rdatatype import TLSA, RdataType
|
||||
|
@ -200,9 +201,10 @@ class _DnsServerInfo(object):
|
|||
if dry_run:
|
||||
continue
|
||||
response = tcp(q=update, where=self.str_ip)
|
||||
if not response.errors:
|
||||
resp_rcode = response.rcode()
|
||||
if resp_rcode != Rcode.NOERROR:
|
||||
raise RuntimeError(
|
||||
f'Update response container errors: {response.errors}')
|
||||
f'Update failed, return code {resp_rcode!r}')
|
||||
|
||||
|
||||
_serverinfo_cache = dict[Configuration, list[_DnsServerInfo]]()
|
||||
|
|
Loading…
Reference in New Issue