1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

samba-tool dns: Trap on conneciton errors and give useful info

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andrew Bartlett 2015-08-07 16:27:23 +12:00 committed by Jeremy Allison
parent 751ea346bc
commit 5701b99b5c

View File

@ -37,7 +37,11 @@ def dns_connect(server, lp, creds):
if server.lower() == 'localhost':
server = '127.0.0.1'
binding_str = "ncacn_ip_tcp:%s[sign]" % server
dns_conn = dnsserver.dnsserver(binding_str, lp, creds)
try:
dns_conn = dnsserver.dnsserver(binding_str, lp, creds)
except RuntimeError, e:
raise CommandError('Connecting to DNS RPC server %s failed with %s' % (server, e))
return dns_conn