diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 74f10427b4e..90d403464dc 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -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()