From 165025a56e14eca51f3db366300fe625d1f521b5 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Wed, 8 May 2019 17:21:27 +1200 Subject: [PATCH] samba_dnsupdate: flush dns update cache file after write While running samba python tests with `coverage.py`, `make test` failed to start ad_dc env since dns_update_cache stays empty. Flush the file after write fix the issue. Signed-off-by: Joe Guo Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- source4/scripting/bin/samba_dnsupdate | 1 + 1 file changed, 1 insertion(+) diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index 2ecb2ce9f1d..9d45de59fd6 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -940,6 +940,7 @@ if rebuild_cache: if opts.verbose: print("Adding %s to %s" % (str(d), file_name)) wfile.write(str(d)+"\n") + wfile.flush() os.rename(tmpfile, dns_update_cache) fcntl.lockf(cfile, fcntl.LOCK_UN) -- 2.47.3