summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-11-28 17:19:50 +1100
committerAmitay Isaacs <amitay@gmail.com>2011-11-29 16:00:36 +1100
commit13545d781b257afe3c3a107a669851c38cdfefbd (patch)
treecc1d9d812981e56bb5e127e90bb0f9feae703b5c /source4/scripting
parent49926a2ac66b9bbaa50735b78a3bf0385c2cf48d (diff)
downloadsamba-13545d781b257afe3c3a107a669851c38cdfefbd.tar.gz
samba-13545d781b257afe3c3a107a669851c38cdfefbd.tar.bz2
samba-13545d781b257afe3c3a107a669851c38cdfefbd.zip
s4-samdb: seqence_number() operation must be in a transaction
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/samdb.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 234a9b9df3..0ad6857cac 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -829,3 +829,17 @@ accountExpires: %u
if sd:
m["nTSecurityDescriptor"] = ndr_pack(sd)
self.add(m)
+
+ def sequence_number(self, seq_type):
+ """Returns the value of the sequence number according to the requested type
+ :param seq_type: type of sequence number
+ """
+ self.transaction_start()
+ try:
+ seq = super(SamDB, self).sequence_number(seq_type)
+ except Exception:
+ self.transaction_cancel()
+ raise
+ else:
+ self.transaction_commit()
+ return seq