summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-25 17:50:14 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-25 20:39:05 +0100
commit9ecc68abe707506b7dc10ce580c7c2ef6b95a785 (patch)
tree4311a15e8089c90b9d8d70ec5e26ea35d774ce02 /source4/scripting
parent08a3d6d6ad2db15ddeec5cc9e57392ea01d881ad (diff)
downloadsamba-9ecc68abe707506b7dc10ce580c7c2ef6b95a785.tar.gz
samba-9ecc68abe707506b7dc10ce580c7c2ef6b95a785.tar.bz2
samba-9ecc68abe707506b7dc10ce580c7c2ef6b95a785.zip
'samba-tool gpo': Properly close transaction.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/gpo.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py
index bd3480e053..94c70c6af3 100644
--- a/source4/scripting/python/samba/netcmd/gpo.py
+++ b/source4/scripting/python/samba/netcmd/gpo.py
@@ -916,11 +916,11 @@ class cmd_create(Command):
# Set ACL
conn.set_acl(sharepath, fs_sd)
-
- self.samdb.transaction_commit()
- except Exception, e:
+ except:
self.samdb.transaction_cancel()
- raise RuntimeError("Error adding GPO to AD", e)
+ raise
+ else:
+ self.samdb.transaction_commit()
self.outf.write("GPO '%s' created as %s\n" % (displayname, gpo))