from .idict import CaseInsensitiveDict
from .istringset import CaseInsensitiveStringSet
-__version__ = '0.7.1'
+__version__ = '0.7.2'
LOG = logging.getLogger(__name__)
CFG_BASENAME = 'ldap-migration.ini'
if rev_dn in self.migrated_entries:
LOG.debug("Entry {!r} is already migrated.".format(tgt_dn))
+ self.write_result_file(fh, tgt_dn, '-')
return False
src_entry = self.get_source_item(src_dn, tgt_dn, with_acl=with_acl)
ch=pp(changes))
raise WriteLDAPItemError(msg)
self.migrated_entries[rev_dn] = tgt_dn
- ts = datetime.datetime.now(self.tz).isoformat(' ', timespec='seconds')
- line = "{dn}: {ts}".format(dn=tgt_dn, ts=ts)
- print(line, file=fh, flush=True)
+ self.write_result_file(fh, tgt_dn, '+')
return True
else:
+ self.write_result_file(fh, tgt_dn, ' ')
return False
(tgt_obj_classes, tgt_entry) = self.generate_target_entry(src_entry, src_dn, tgt_dn)
raise WriteLDAPItemError(msg)
self.migrated_entries[rev_dn] = tgt_dn
+ self.write_result_file(fh, tgt_dn, '*')
+ return True
+
+ # -------------------------------------------------------------------------
+ def write_result_file(self, fh, dn, tag=' '):
+
ts = datetime.datetime.now(self.tz).isoformat(' ', timespec='seconds')
- line = "{dn}: {ts}".format(dn=tgt_dn, ts=ts)
+ line = "{tag}{dn}: {ts}".format(tag=tag, dn=dn, ts=ts)
print(line, file=fh, flush=True)
- return True
# -------------------------------------------------------------------------
def compare_values(self, first, second):