git.samba.org
/
kai
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49926a2
)
s4-samdb: seqence_number() operation must be in a transaction
author
Amitay Isaacs
<amitay@gmail.com>
Mon, 28 Nov 2011 06:19:50 +0000
(17:19 +1100)
committer
Amitay Isaacs
<amitay@gmail.com>
Tue, 29 Nov 2011 05:00:36 +0000
(16:00 +1100)
source4/scripting/python/samba/samdb.py
patch
|
blob
|
history
diff --git
a/source4/scripting/python/samba/samdb.py
b/source4/scripting/python/samba/samdb.py
index 234a9b9df304a684045201482615baf7b198beee..0ad6857cac21ca39c5b7d9f8f71d248c8510b675 100644
(file)
--- 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