From b727975ee2d3629a4fec5a2c45664db43833e7b7 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 25 Jan 2024 15:03:28 +0100 Subject: [PATCH] Some formattings --- lib/pp_admintools/app/mirror_ldap.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/pp_admintools/app/mirror_ldap.py b/lib/pp_admintools/app/mirror_ldap.py index cd0d074..c76300f 100644 --- a/lib/pp_admintools/app/mirror_ldap.py +++ b/lib/pp_admintools/app/mirror_ldap.py @@ -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.", -- 2.39.5