summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2016-07-27 09:40:09 +1200
committerGarming Sam <garming@samba.org>2016-11-22 02:10:16 +0100
commitf4d6e2ab7008c284084e4e804a86bd9090a42d63 (patch)
treed0ac77242eb318d93ee94666f56150077cef7e68
parent683fcad3ca1617a07e9ade82ec7e44ac512ab415 (diff)
downloadsamba-f4d6e2ab7008c284084e4e804a86bd9090a42d63.tar.gz
samba_dnsupdate: cmd._run doesn't have Exceptions
It returns a return code of -1 instead. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rwxr-xr-xsource4/scripting/bin/samba_dnsupdate8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate
index 16265f639fd..d18d8bd1f19 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -554,7 +554,13 @@ def call_samba_tool(d, op="add", zone=None):
cmd = cmd_dns()
if opts.verbose:
print "Calling samba-tool dns %s -k no -P %s" % (op, args)
- cmd._run("dns", op, "-k", "no", "-P", *args)
+ ret = cmd._run("dns", op, "-k", "no", "-P", *args)
+ if ret == -1:
+ if opts.fail_immediately:
+ sys.exit(1)
+ error_count = error_count + 1
+ if opts.verbose:
+ print("Failed 'samba-tool dns' based update: %s : %s" % (str(d), estr))
except Exception, estr:
raise
if opts.fail_immediately: