samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Feb 2019 08:40:19 +0000 (09:40 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Feb 2019 01:18:28 +0000 (02:18 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_dnsupdate

index 74f10427b4e6c082e904600c2c9546f2221e7e5a..90d403464dc00b186864f2c9ef8806a4e1624c9a 100755 (executable)
@@ -443,10 +443,10 @@ def call_nsupdate(d, op="add"):
 
     assert(op in ["add", "delete"])
 
-    if opts.verbose:
-        print("Calling nsupdate for %s (%s)" % (d, op))
-
     if opts.use_file is not None:
+        if opts.verbose:
+            print("Use File instead of nsupdate for %s (%s)" % (d, op))
+
         try:
             rfile = open(opts.use_file, 'r+')
         except IOError:
@@ -471,6 +471,9 @@ def call_nsupdate(d, op="add"):
         fcntl.lockf(rfile, fcntl.LOCK_UN)
         return
 
+    if opts.verbose:
+        print("Calling nsupdate for %s (%s)" % (d, op))
+
     normalised_name = d.name.rstrip('.') + '.'
 
     (tmp_fd, tmpfile) = tempfile.mkstemp()