From f4d6e2ab7008c284084e4e804a86bd9090a42d63 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Wed, 27 Jul 2016 09:40:09 +1200 Subject: [PATCH] samba_dnsupdate: cmd._run doesn't have Exceptions It returns a return code of -1 instead. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_dnsupdate | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: -- 2.11.4.GIT