Merge pull request #360 from ThomasWaldmann/exception-fixes
more exception fixes
This commit is contained in:
commit
bdf984e5e3
@ -214,6 +214,8 @@ def update(fqdn, ipaddr, ttl=60):
|
|||||||
# maybe could be caused by secondary DNS Timeout and master still ok?
|
# maybe could be caused by secondary DNS Timeout and master still ok?
|
||||||
# assume the update is OK...
|
# assume the update is OK...
|
||||||
ok = True
|
ok = True
|
||||||
|
except dns.message.UnknownTSIGKey:
|
||||||
|
raise DnsUpdateError("UnknownTSIGKey")
|
||||||
if ok:
|
if ok:
|
||||||
# only send an update if the ip really changed as the update
|
# only send an update if the ip really changed as the update
|
||||||
# causes write I/O on the nameserver and also traffic to the
|
# causes write I/O on the nameserver and also traffic to the
|
||||||
|
@ -3,6 +3,7 @@ dealing with domains (Domain records in our database)
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
import dns.message
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.core.mail import send_mail
|
from django.core.mail import send_mail
|
||||||
@ -60,7 +61,7 @@ def check_dns(domain):
|
|||||||
query_ns(fqdn, 'SOA', prefer_primary=True)
|
query_ns(fqdn, 'SOA', prefer_primary=True)
|
||||||
queries_ok = True
|
queries_ok = True
|
||||||
except (dns.resolver.Timeout, dns.resolver.NoNameservers,
|
except (dns.resolver.Timeout, dns.resolver.NoNameservers,
|
||||||
dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, NameServerNotAvailable):
|
dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, NameServerNotAvailable, dns.message.UnknownTSIGKey):
|
||||||
# note: currently the domain is also set to unavailable as a
|
# note: currently the domain is also set to unavailable as a
|
||||||
# side effect in query_ns()
|
# side effect in query_ns()
|
||||||
queries_ok = False
|
queries_ok = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user