]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Some formattings
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 25 Jan 2024 14:03:28 +0000 (15:03 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 25 Jan 2024 14:03:28 +0000 (15:03 +0100)
lib/pp_admintools/app/mirror_ldap.py

index cd0d074f4b8cbfd81c6fe495812dcce7b05323f1..c76300f98c27d477aad8ecf0ba2fabef805d2a65 100644 (file)
@@ -36,7 +36,7 @@ from ..argparse_actions import NonNegativeIntegerOptionAction
 from ..config.mirror_ldap import MirrorLdapConfiguration
 from ..xlate import XLATOR
 
-__version__ = '1.0.0'
+__version__ = '1.0.1'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -234,9 +234,12 @@ class MirrorLdapApplication(BaseLdapApplication):
         src_url = self.cfg.ldap_connection[self.src_instance].url
         tgt_url = self.cfg.ldap_connection[self.tgt_instance].url
         msg = _(
-            'Start mirroring LDAP instance {src!r} ({src_url}) to instance {tgt!r} ({tgt_url}) '
+            'Start mirroring LDAP instance {src} ({src_url}) to instance {tgt} ({tgt_url}) '
             '[{yes}/{no}]?').format(
-            src=self.src_instance, src_url=src_url, tgt=self.tgt_instance, tgt_url=tgt_url,
+            src=("'" + self.colored(self.src_instance, 'CYAN') + "'"),
+            src_url=self.colored(src_url, 'CYAN'),
+            tgt=("'" + self.colored(self.tgt_instance, 'CYAN') + "'"),
+            tgt_url=self.colored(tgt_url, 'CYAN'),
             yes=self.colored(_('yes'), 'RED'), no=self.colored(_('No'), 'GREEN')) + ' '
 
         self.empty_line()
@@ -246,6 +249,11 @@ class MirrorLdapApplication(BaseLdapApplication):
             LOG.error(_('Interrupted on demand.'))
             self.exit(3)
 
+        start_msg = _(
+            'Start mirroring LDAP instance {src!r} ({src_url}) to instance {tgt!r} '
+            '({tgt_url}) ...').format(
+            src=self.src_instance, src_url=src_url, tgt=self.tgt_instance, tgt_url=tgt_url)
+
         if not self.quiet and not self.force:
             self.empty_line()
             msg = _(
@@ -258,6 +266,8 @@ class MirrorLdapApplication(BaseLdapApplication):
         self.line(linechar='=', color='CYAN')
         LOG.info("I'm walking, yes indeed I'm walking ...")
         self.empty_line()
+        LOG.info(start_msg)
+
         if self.wait_after_write and not self.simulate:
             msg = ngettext(
                 "Waiting one second after write actions.",