1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-13 16:23:50 +03:00

forest_update: be more verbose about updates

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher
2023-02-23 15:10:33 +01:00
committed by Andrew Bartlett
parent 65275acf05
commit a8c0e82f92

View File

@@ -260,13 +260,20 @@ revision: %d
:param op: Integer update number
:return: True if update exists else False
"""
update_dn = "CN=%s,%s" % (update_map[op], self.forestupdate_container)
try:
res = self.samdb.search(base=self.forestupdate_container,
expression="(CN=%s)" % update_map[op])
except ldb.LdbError:
res = self.samdb.search(base=update_dn,
scope=ldb.SCOPE_BASE,
attrs=[])
except ldb.LdbError as e:
(num, msg) = e.args
if num != ldb.ERR_NO_SUCH_OBJECT:
raise
return False
return len(res) == 1
assert len(res) == 1
print("Skip Forest Update %u: %s" % (op, update_map[op]))
return True
def update_add(self, op):
"""
@@ -276,6 +283,7 @@ revision: %d
self.samdb.add_ldif("""dn: CN=%s,%s
objectClass: container
""" % (update_map[op], str(self.forestupdate_container)))
print("Applied Forest Update %u: %s" % (op, update_map[op]))
def operation_ldif(self, op):
if self.update_exists(op):