samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate
[samba.git] / 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()