self.error_logfile = None
self.lap = 0
self.total_count = 0
+ self.do_aci = False
self.struct_entries = []
self.all_entries = []
help="Migrate only structural entries (entries with childs).",
)
+ app_group.add_argument(
+ '-A', '--aci', action="store_true", dest="aci",
+ help="Migrate also ACI entries.",
+ )
+
app_group.add_argument(
'-c', '--config', '--config-file', dest='cfg_file', metavar='FILE',
action=CfgFileOptionAction,
if self.args.struct:
self.only_struct = True
+ if self.args.aci:
+ self.do_aci = True
+
self.initialized = True
# -------------------------------------------------------------------------
try:
self._migrate_entries(
self.struct_dns, fh=fh, force=False, is_root=True,
- with_group_entries=True, with_acl=True)
+ with_group_entries=True, with_acl=self.do_aci)
except CommonLDAPMigrationError as e:
msg = "Abort migration by {c}: {e}".format(c=e.__class__.__name__, e=e)
LOG.error(msg)
for src_dn in self.all_entries:
try:
if self.migrate_entry(
- src_dn, fh=fh, force=False, with_acl=True, migrate_if_group=False):
+ src_dn, fh=fh, force=False, with_acl=self.do_aci, migrate_if_group=False):
if wait:
time.sleep(wait)
except FatalLDAPMigrationError as e:
msg = "Migrating group entry {src!r} -> {tgt!r} ...".format(src=src_dn, tgt=tgt_dn)
LOG.info(msg)
- src_entry = self.get_source_item(src_dn, tgt_dn, with_acl=False)
- tgt_entry = self.get_target_item(tgt_dn, with_acl=False)
+ src_entry = self.get_source_item(src_dn, tgt_dn, with_acl=self.do_aci)
+ tgt_entry = self.get_target_item(tgt_dn, with_acl=self.do_aci)
try:
if tgt_entry: