From: Frank Brehm Date: Mon, 24 Oct 2022 16:24:51 +0000 (+0200) Subject: Evaluating config X-Git-Tag: 0.7.0^2~1^2~25 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=77be397f4827d481d1b809423e12379b178f1180;p=pixelpark%2Fpp-admin-tools.git Evaluating config --- diff --git a/lib/pp_admintools/app/mirror_ldap.py b/lib/pp_admintools/app/mirror_ldap.py index 4206c63..f605264 100644 --- a/lib/pp_admintools/app/mirror_ldap.py +++ b/lib/pp_admintools/app/mirror_ldap.py @@ -36,7 +36,7 @@ from .ldap import BaseLdapApplication from ..argparse_actions import NonNegativeItegerOptionAction from ..argparse_actions import LimitedFloatOptionAction -__version__ = '0.5.0' +__version__ = '0.5.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -161,6 +161,19 @@ class MirrorLdapApplication(BaseLdapApplication): self.wait = getattr(self.args, 'wait', self.default_wait_after_write) self._check_source_instance() + self._eval_keep_dns() + + # ------------------------------------------------------------------------- + def _eval_keep_dns(self): + + if self.tgt_instance not in self.cfg.entries_keep: + if self.verbose > 4: + LOG.debug(_("Did not found {tgt!r} in {e}:").format( + tgt=self.tgt_instance, e='self.cfg.entries_keep') + '\n' + pp( + self.cfg.entries_keep)) + return + + self.keep_entry_dns = copy.copy(self.cfg.entries_keep[self.tgt_instance]) # ------------------------------------------------------------------------- def _check_source_instance(self):