summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2022-03-24 18:39:55 +1300
committerDouglas Bagnall <dbagnall@samba.org>2022-08-06 01:42:09 +0000
commit0fdd7e16a1d2c68e3fa4262c8e7355b0889c5b66 (patch)
tree0a533eaeea40bdeff59860629f3843d1058481a5 /python
parent5750d7a1d05bccf61b3ae0ea4dcb36e0c103cb26 (diff)
downloadsamba-0fdd7e16a1d2c68e3fa4262c8e7355b0889c5b66.tar.gz
samba-tool gpo: clean up tmpdir after create
'fetch' and 'backup' might also leave files in /tmp, but in those cases we want the files. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15006 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: David Mulder <dmulder@suse.com> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Sat Aug 6 01:42:09 UTC 2022 on sn-devel-184
Diffstat (limited to 'python')
-rw-r--r--python/samba/netcmd/gpo.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py
index 3b21dc6128c..fe8afa7d9a0 100644
--- a/python/samba/netcmd/gpo.py
+++ b/python/samba/netcmd/gpo.py
@@ -1296,6 +1296,10 @@ class cmd_create(GPOCommand):
else:
self.samdb.transaction_commit()
+ if tmpdir is None:
+ # Without --tmpdir, we created one in /tmp/. It must go.
+ shutil.rmtree(self.tmpdir)
+
self.outf.write("GPO '%s' created as %s\n" % (displayname, gpo))