181 |
181 |
except ldap.NO_SUCH_OBJECT:
|
182 |
182 |
return []
|
183 |
183 |
|
|
184 |
def _log_changes(self, dn, old_entry, new_entry):
|
|
185 |
''' Log changes on enty '''
|
|
186 |
new_attrs = to_dict_of_set(bytes2str_entry(old_entry))
|
|
187 |
old_attrs = to_dict_of_set(bytes2str_entry(new_entry))
|
|
188 |
|
|
189 |
for attr in new_attrs:
|
|
190 |
if attr not in old_attrs:
|
|
191 |
self.logger.debug(
|
|
192 |
'%s: attribute %s added ("%s")',
|
|
193 |
dn, attr, '", "'.join(new_attrs[attr]))
|
|
194 |
elif new_attrs[attr] != old_attrs[attr]:
|
|
195 |
self.logger.debug(
|
|
196 |
'%s: attribute %s modified ("%s" -> "%s")',
|
|
197 |
dn, attr, '", "'.join(old_attrs[attr]), '", "'.join(new_attrs[attr]))
|
|
198 |
|
|
199 |
for attr in old_attrs:
|
|
200 |
if attr not in new_attrs:
|
|
201 |
self.logger.debug(
|
|
202 |
'%s: attribute %s deleted ("%s")',
|
|
203 |
dn, attr, '", "'.join(old_attrs[attr]))
|
|
204 |
|
184 |
205 |
def build_actions_for_entries(self, entries):
|
185 |
206 |
seen_dn = self.seen_dn
|
186 |
207 |
renamed_dn = self.renamed_dn
|
... | ... | |
226 |
247 |
self.rename(new_out_dn, target_dn)
|
227 |
248 |
renamed_dn[str2dn(new_out_dn)] = str2dn(target_dn)
|
228 |
249 |
if to_dict_of_set(out_entry) != to_dict_of_set(bytes2str_entry(entry)):
|
|
250 |
self._log_changes(target_dn, entry, out_entry)
|
229 |
251 |
new_entry = {}
|
230 |
252 |
for attribute in self.attributes:
|
231 |
253 |
if attribute in to_dict_of_set(entry):
|
232 |
|
-
|