from ..argparse_actions import NonNegativeItegerOptionAction
from ..argparse_actions import LimitedFloatOptionAction
-__version__ = '0.5.2'
+__version__ = '0.5.3'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
for dn in sorted(list(self.tgt_dns_current.keys()), key=cmp_to_key(self.compare_ldap_dns)):
- if dn in self.keep_entry_dns:
- LOG.debug(_("Entry {!r} is set to be kept.").format(dn))
- continue
-
- if dn in self.sync_entry_dns:
- LOG.debug(_("Entry {!r} is set to be synchronized.").format(dn))
- continue
-
entry = self.tgt_dns_current[dn]
if 'childs' not in entry:
LOG.error("Found entry {dn!r}:\n{e}".format(dn=dn, e=pp(entry)))
"Entry {!r} is a structural entry, will not be removed "
"at this point.").format(dn))
continue
+
+ if dn in self.keep_entry_dns:
+ LOG.debug(_("Entry {!r} is set to be kept.").format(dn))
+ continue
+
+ if dn in self.sync_entry_dns:
+ LOG.debug(_("Entry {!r} is set to be synchronized.").format(dn))
+ continue
+
self.delete_entry(self.tgt_instance, dn)
if self.wait_after_write and not self.simulate:
time.sleep(self.wait_after_write)
dns = sorted(list(self.tgt_dns_current.keys()), key=cmp_to_key(self.compare_ldap_dns))
- for dn in list(reversed(dns[1:])):
+ for dn in list(reversed(dns)):
+
+ entry = self.tgt_dns_current[dn]
+ if not entry['childs']:
+ continue
if dn in self.keep_entry_dns:
LOG.debug(_("Entry {!r} is set to be kept.").format(dn))
LOG.debug(_("Entry {!r} is set to be synchronized.").format(dn))
continue
- entry = self.tgt_dns_current[dn]
- if not entry['childs']:
- continue
self.delete_entry(self.tgt_instance, dn)
if self.wait_after_write and not self.simulate:
time.sleep(self.wait_after_write)