'samba-tool gpo': Properly close transaction.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 25 Feb 2012 16:50:14 +0000 (17:50 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 25 Feb 2012 19:39:05 +0000 (20:39 +0100)
source4/scripting/python/samba/netcmd/gpo.py

index bd3480e053a73bc8f37277b491d6c43f7ce77d2d..94c70c6af3b491aa1ddd598e8af18f51d43d3c92 100644 (file)
@@ -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))