]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Evaluating config
authorFrank Brehm <frank@brehm-online.com>
Mon, 24 Oct 2022 16:24:51 +0000 (18:24 +0200)
committerFrank Brehm <frank@brehm-online.com>
Mon, 24 Oct 2022 16:24:51 +0000 (18:24 +0200)
lib/pp_admintools/app/mirror_ldap.py

index 4206c63b82f3c37f050db451f52433ca5d890dd5..f605264005babd0b097d39add82031963c320686 100644 (file)
@@ -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):