from .xlate import __mo_file__ as __xlate_mo_file__
from .xlate import XLATOR, LOCALE_DIR, DOMAIN
-__version__ = '1.5.0'
+__version__ = '1.6.0'
LOG = logging.getLogger(__name__)
SIGNAL_NAMES = {
# PowerDNS options
pdns_group = self.arg_parser.add_argument_group(_('PowerDNS options'))
- pdns_group.add_argument(
- '--pdns', action="store_true", dest='do_pdns',
- help=_('Execute PowerDNS checks or actions.')
- )
+ enable_pdns_group = pdns_group.add_mutually_exclusive_group()
+
+ help_text = _('Execute PowerDNS checks or actions.')
+ if not CrTfConfiguration.default_no_pdns:
+ help_text += ' ' + _('(Default)')
+ enable_pdns_group.add_argument(
+ '--pdns', action="store_true", dest='do_pdns', help=help_text)
+
+ help_text = _('Do not execute PowerDNS checks or actions.')
+ if CrTfConfiguration.default_no_pdns:
+ help_text += ' ' + _('(Default)')
+ enable_pdns_group.add_argument(
+ '--no-pdns', action="store_false", dest='do_pdns', help=help_text)
pdns_group.add_argument(
'-M', '--pdns-master', metavar=_("HOST"), dest='pdns_master',
# -------------------------------------------------------------------------
def perform_arg_parser_pdns(self):
- if self.args.do_pdns:
- self.config.no_pdns = False
+ do_pdns = getattr(self.args, 'do_pdns', None)
+ if do_pdns is not None:
+ if do_pdns:
+ self.config.no_pdns = False
+ else:
+ self.config.no_pdns = True
+
if self.args.pdns_master:
self.config.pdns_master_server = self.args.pdns_master
if self.args.pdns_api_port:
LOG.info(_("Starting {a!r}, version {v!r} ...").format(
a=self.appname, v=__pkg_version__))
+ LOG.debug('self.args.do_pdns: {!r}'.format(self.args.do_pdns))
+ LOG.debug('self.config.no_pdns: {!r}'.format(self.config.no_pdns))
+
+ if self.config.no_pdns:
+ msg = _('Automatic creation of DNS A- and PTR-records is disabled.')
+ else:
+ msg = _('Automatic creation of DNS A- and PTR-records is enabled.')
+ length = len(msg) + 6
+ star = self.colored('*', 'cyan')
+ msg = star + ' ' + self.colored(msg, 'yellow') + ' ' + star
+ line = self.colored(('*' * length), 'cyan')
+ print()
+ print(line)
+ print(msg)
+ print(line)
+ print()
+
try:
if self.handler.first_call(self.yaml_file):
self.verify_vsphere_credentials()
from .xlate import XLATOR
-__version__ = '1.11.0'
+__version__ = '1.12.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
and methods to read it from configuration files.
"""
+ default_no_pdns = True
+
default_spinner = 'random'
default_pdns_master_server = 'master.pp-dns.com'
self._vsphere_tag_os_rhel_name = self.default_vsphere_tag_os_rhel_name
self._vsphere_tag_os_rhel_desc = self.default_vsphere_tag_os_rhel_desc
- self._no_pdns = True
+ self._no_pdns = self.default_no_pdns
self.puppet_envs_add = set()
self.puppet_envs_delete = set()