s4-dns: added support for --fail-immediately for RODC netlogon dns updates
authorAndrew Tridgell <tridge@samba.org>
Thu, 18 Nov 2010 03:53:20 +0000 (14:53 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 18 Nov 2010 22:12:25 +0000 (23:12 +0100)
source4/scripting/bin/samba_dnsupdate

index 1b5bc3eb8a89d72f0d27512514e2a59fee88f3f0..8f0489565584295a0b659bc9bd9590b0f8a3d592 100755 (executable)
@@ -301,12 +301,19 @@ def rodc_dns_update(d, t):
     dns_names.names = [ name ]
     site_name = sub_vars['SITE'].decode('utf-8')
 
+    global error_count
+
     try:
         ret_names = w.DsrUpdateReadOnlyServerDnsRecords(site_name, default_ttl, dns_names)
         if ret_names.names[0].status != 0:
             print("Failed to set DNS entry: %s (status %u)" % (d, ret_names.names[0].status))
+            error_count = error_count + 1
     except RuntimeError, reason:
         print("Error setting DNS entry of type %u: %s: %s" % (t, d, reason))
+        error_count = error_count + 1
+
+    if error_count != 0 and opts.fail_immediately:
+        sys.exit(1)
 
 
 def call_rodc_update(d):