samba_dnsupdate: Don't use subprocess.check_call, it isn't in python 2.4
[kai/samba.git] / source4 / scripting / bin / samba_dnsupdate
index 99f898e2044d52dbed4dcaecffd87d41f5f7690a..695bed6e80fb715cb2e67c4d830b3d52a21f6562 100755 (executable)
@@ -263,7 +263,14 @@ def call_nsupdate(d):
     try:
         cmd = nsupdate_cmd[:]
         cmd.append(tmpfile)
-        subprocess.check_call(cmd, shell=False)
+        ret = subprocess.call(cmd, shell=False)
+        if ret != 0:
+            global error_count
+            if opts.fail_immediately:
+                sys.exit(1)
+            error_count = error_count + 1
+            if opts.verbose:
+                print("Failed nsupdate: %d" % ret)
     except Exception, estr:
         global error_count
         if opts.fail_immediately: