_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.5.0'
+__version__ = '0.5.1'
# =============================================================================
argparse_epilog=None, argparse_prefix_chars='-', env_prefix=None,
config_dir=DEFAULT_CONFIG_DIR):
- self.init_yes_no_lists()
-
- self._yes = False
- self._prompt_timeout = self.default_prompt_timeout
-
super(BaseDPXApplication, self).__init__(
appname=appname, verbose=verbose, version=version, base_dir=base_dir,
description=description, cfg_class=cfg_class, initialized=False,
from fb_tools.common import pp
# from fb_tools.collections import FrozenCIStringSet, CIStringSet, CIDict
from fb_tools.collections import CIDict, CIStringSet
+from fb_tools.errors import AbortAppError, TimeoutOnPromptError
from ..xlate import XLATOR
from ..argparse_actions import NonNegativeItegerOptionAction
from ..argparse_actions import LimitedFloatOptionAction
-__version__ = '0.4.0'
+__version__ = '0.4.1'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
# -------------------------------------------------------------------------
def _run(self):
+ 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}) "
+ "[{yes}/{no}]?").format(
+ src=self.src_instance, src_url=src_url, tgt=self.tgt_instance, tgt_url=tgt_url,
+ yes=self.colored(_('yes'), 'RED'), no=self.colored(_('No'), 'GREEN')) + ' '
+
+ self.empty_line()
+ answer = self.ask_for_yes_or_no(msg)
+ if not answer:
+ self.empty_line()
+ LOG.error(_("Interrupted on demand."))
+ self.exit(3)
+
if not self.quiet and not self.force:
self.empty_line()
- 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}) ...").format(
from .ldap import LdapAppError, FatalLDAPError
from .ldap import BaseLdapApplication
-__version__ = '0.5.5'
+__version__ = '0.5.7'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
msg = _("Remove [{yes}/{no}]?")
msg = msg.format(
yes=self.colored(_('yes'), 'RED'), no=self.colored(_('No'), 'GREEN')) + ' '
- try:
- return self.ask_for_yes_or_no(msg)
- except (TimeoutOnPromptError, AbortAppError) as e:
- if self.deactivate:
- msg = _("Abort deactivating by {cls}: {e}")
- else:
- msg = _("Abort removing by {cls}: {e}")
- LOG.error(msg.format(cls=e.__class__.__name__, e=e))
- return False
-
- return True
+ return self.ask_for_yes_or_no(msg)
# -------------------------------------------------------------------------
def eval_user_dns(self, user):