diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-11-02 09:02:15 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-11-07 17:55:08 +0100 |
commit | a9682f94d40f715a1ea06898ca42c27437b5610b (patch) | |
tree | ef55d61562fd09771d28d295b5afa5f717e740ca /python/samba/upgradehelpers.py | |
parent | 3ca13997e5017fb00032c6044d8dc8eab2a13221 (diff) | |
download | samba-a9682f94d40f715a1ea06898ca42c27437b5610b.tar.gz |
python/upgradehelpers: use mkstemp, not mktemp
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/upgradehelpers.py')
-rw-r--r-- | python/samba/upgradehelpers.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/samba/upgradehelpers.py b/python/samba/upgradehelpers.py index 672268af4df..40120bd7190 100644 --- a/python/samba/upgradehelpers.py +++ b/python/samba/upgradehelpers.py @@ -814,14 +814,15 @@ def print_provision_ranges(dic, limit_print, dest, samdb_path, invocationid): obj["max"], id) if ldif != "": - file = tempfile.mktemp(dir=dest, prefix="usnprov", suffix=".ldif") + fd, file = tempfile.mkstemp(dir=dest, prefix="usnprov", suffix=".ldif") print() print("To track the USNs modified/created by provision and upgrade proivsion,") print(" the following ranges are proposed to be added to your provision sam.ldb: \n%s" % ldif) print("We recommend to review them, and if it's correct to integrate the following ldif: %s in your sam.ldb" % file) print("You can load this file like this: ldbadd -H %s %s\n" %(str(samdb_path), file)) ldif = "dn: @PROVISION\nprovisionnerID: %s\n%s" % (invocationid, ldif) - open(file, 'w').write(ldif) + os.write(fd, ldif) + os.close(fd) def int64range2str(value): |