from .config import LDAPMigrationConfiguration
-__version__ = '0.10.0'
+__version__ = '0.10.1'
LOG = logging.getLogger(__name__)
CFG_BASENAME = 'ldap-migration.ini'
'src_dn': src_dn,
'object_classes': self.group_entries[tgt_dn]['object_classes'],
}
- LOG.info("Group entry {src!} -> {tgt!r} successful migrated.".format(
+ LOG.info("Group entry {src!r} -> {tgt!r} successful migrated.".format(
src=src_dn, tgt=tgt_dn))
else:
LOG.info((
- "Group entry {src!} -> {tgt!r} could not migrated "
+ "Group entry {src!r} -> {tgt!r} could not migrated "
"in lap {lap}.").format(src=src_dn, tgt=tgt_dn, lap=lap))
for tgt_dn in migrated_dns:
# -------------------------------------------------------------------------
def detailled_summary(self):
- if self.verbose > 1:
- print()
- print(self.colored('Migrated items:', 'GREEN'))
- print(self.colored('###############', 'GREEN'))
- for key in self.migrated_entries:
- print(self.colored(' * {!r}'.format(key), 'GREEN'))
+ if self.verbose:
if len(self.src_items_not_found):
print()
- print(self.colored('Not migrated items:', 'AQUA'))
- print(self.colored('###################', 'AQUA'))
+ print(self.colored('Not migrated entries:', 'AQUA'))
+ print(self.colored('#####################', 'AQUA'))
for dn in self.src_items_not_found:
print(self.colored(' * {!r}'.format(dn), 'AQUA'))
- if self.verbose:
+ if len(self.group_entries):
+ print()
+ print(self.colored('Not migrated group entries:', 'AQUA'))
+ print(self.colored('###########################', 'AQUA'))
+ for dn in self.group_entries:
+ print(self.colored(' * {!r}'.format(dn), 'AQUA'))
if len(self.unknown_attributetypes):
print()
print(self.colored('Unknown and not migrated Attribute Types:', 'AQUA'))
# -------------------------------------------------------------------------
def summary(self):
- count_groups = 0
- if self.group_entries:
- count_groups = len(self.group_entries)
-
+ count_groups = len(self.group_entries)
+ count_migrated_groups = len(self.migrated_group_entries)
count_ignored = len(self.ignored_entries)
print()
total = self.count_unchanged + self.count_added + self.count_modified
- total += count_groups + count_ignored
+ total += count_groups + count_migrated_groups + count_ignored
+ print()
+ print(self.colored('Performed entries:', 'GREEN'))
+ print(self.colored('##################', 'GREEN'))
+ print(self.colored(' * {:>5} total'.format(total), 'GREEN'))
+ print(self.colored(' * {:>5} added'.format(self.count_added), 'GREEN'))
+ print(self.colored(' * {:>5} modified'.format(self.count_modified), 'GREEN'))
+ print(self.colored(' * {:>5} unchanged'.format(self.count_unchanged), 'GREEN'))
+ print(self.colored(' * {:>5} migrated groups'.format(count_migrated_groups), 'GREEN'))
+ print(self.colored(' * {:>5} ignored groups'.format(count_groups), 'CYAN'))
+ print(self.colored(' * {:>5} ignored entries'.format(count_ignored), 'CYAN'))
msg = (
"Performed all entries: {to} total, {ad} added, {mo} modified, "
- "{un} unchanged, {g} ignored groups, {ig} ignored items.").format(
- to=total, ad=self.count_added, mo=self.count_modified,
- un=self.count_unchanged, g=count_groups, ig=count_ignored)
- LOG.info(msg)
+ "{un} unchanged, {mg} migrated groups, {g} ignored groups, "
+ "{ig} ignored items.").format(
+ to=total, ad=self.count_added, mo=self.count_modified, un=self.count_unchanged,
+ mg=count_migrated_groups, g=count_groups, ig=count_ignored)
+ LOG.debug(msg)
print()
# -------------------------------------------------------------------------