From 767e60d97390f90e1b0579d4108ede51a9116952 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 7 Feb 2019 09:40:19 +0100 Subject: [PATCH] samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_dnsupdate | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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() -- 2.34.1