mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
upgradeprovision: Fix use of dict.get().
Avoid modifying list while iterating over it. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Wed Jan 5 03:37:35 CET 2011 on sn-devel-104
This commit is contained in:
parent
e80b322077
commit
26c8a520f3
@ -855,19 +855,13 @@ def update_present(ref_samdb, samdb, basedn, listPresent, usns, invocationid):
|
||||
isFirst = 0
|
||||
txt = ""
|
||||
|
||||
for att in delta:
|
||||
for att in list(delta):
|
||||
if usns is not None:
|
||||
# We have updated by provision usn information so let's exploit
|
||||
# replMetadataProperties
|
||||
if att in forwardlinked:
|
||||
if current[0].get():
|
||||
curval = current[0][att]
|
||||
else:
|
||||
curval = ()
|
||||
if reference[0].get():
|
||||
refval = reference[0][att]
|
||||
else:
|
||||
refval = ()
|
||||
curval = current[0].get(att, ())
|
||||
refval = reference[0].get(att, ())
|
||||
handle_links(samdb, att, basedn, current[0]["dn"],
|
||||
curval, refval, delta)
|
||||
continue
|
||||
@ -1696,8 +1690,8 @@ if __name__ == '__main__':
|
||||
for att in deltaattr:
|
||||
if att.lower() == "dn":
|
||||
continue
|
||||
if deltaattr.get(att) is not None \
|
||||
and deltaattr.get(att).flags() != FLAG_MOD_ADD:
|
||||
if (deltaattr.get(att) is not None
|
||||
and deltaattr.get(att).flags() != FLAG_MOD_ADD):
|
||||
doit = False
|
||||
elif deltaattr.get(att) is None:
|
||||
doit = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user