metasync: move initialization of actions out of the main loop

This commit is contained in:
Benjamin Dauvergne 2015-05-19 22:13:19 +02:00
parent 9b7d4b2ced
commit a4c68afbaa
1 changed files with 1 additions and 1 deletions

View File

@ -282,6 +282,7 @@ batched = 0
batch = []
seen_dns = set()
renames, creates, updates, deletes = 0, 0, 0, 0
actions = []
for results in batch_generator(rconn.paged_search_ext_s(
args.ldap_basedn,
ldap.SCOPE_SUBTREE,
@ -297,7 +298,6 @@ for results in batch_generator(rconn.paged_search_ext_s(
filters.append(filter_format(
filter_tpl, (objc, value)))
found_dns = get_found_dns(filters)
actions = []
for k, (dn, entry) in new_dns.iteritems():
target_dn = new_dn(dn)
seen_dns.add(target_dn)