diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-30 15:23:39 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-12-01 00:14:40 +0100 |
commit | 1286f5345515bec5295497b1370db830262c3890 (patch) | |
tree | a8ce79957ef8cc393f078d1bd7245ce413f112f0 /source4 | |
parent | 29c4f3fa61c7bea39abecbd52f7170b97a9d53d3 (diff) | |
download | samba-1286f5345515bec5295497b1370db830262c3890.tar.gz samba-1286f5345515bec5295497b1370db830262c3890.tar.bz2 samba-1286f5345515bec5295497b1370db830262c3890.zip |
s4-dns: catch all DNS exceptions in samba_dnsupdate
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/scripting/bin/samba_dnsupdate | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 8f04895655..faba124336 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -46,7 +46,8 @@ from samba.samdb import SamDB from samba.dcerpc import netlogon, winbind samba.ensure_external_module("dns", "dnspython") -import dns.resolver as resolver +import dns.resolver +import dns.exception default_ttl = 900 am_rodc = False @@ -172,8 +173,10 @@ def check_dns_name(d): return False try: - ans = resolver.query(normalised_name, d.type) - except resolver.NXDOMAIN: + ans = dns.resolver.query(normalised_name, d.type) + except dns.exception.DNSException: + if opts.verbose: + print "Failed to find DNS entry %s" % d return False if d.type == 'A': # we need to be sure that our IP is there @@ -194,8 +197,9 @@ def check_dns_name(d): else: d.existing_port = str(rdata.port) d.existing_weight = str(rdata.weight) + if opts.verbose: - print "Failed to find DNS entry %s" % d + print "Failed to find matching DNS entry %s" % d return False |