try:
port = int(values)
except (ValueError, TypeError) as e:
- msg = _("Value {v!r} for a {what} port is invalid:").format(v=values, what=what)
+ msg = _("Value {v!r} for a {what} port is invalid:").format(v=values, what=self.what)
+ msg += ' ' + str(e)
raise argparse.ArgumentError(self, msg)
if port <= 0 or port > MAX_PORT_NUMBER:
msg = _("Value {v!r} for a {what} port must be greater than 0 and less than {max}.")
- msg = msg.format(v=values, what=what, max=(MAX_PORT_NUMBER + 1))
+ msg = msg.format(v=values, what=self.what, max=(MAX_PORT_NUMBER + 1))
raise argparse.ArgumentError(self, msg)
setattr(namespace, self.dest, port)
try:
timeout = int(values)
except (ValueError, TypeError) as e:
- msg = _("Value {v!r} for a timeout of {what} is invalid:").format(v=values, what=what)
+ msg = _("Value {v!r} for a timeout of {what} is invalid:").format(
+ v=values, what=self.what)
+ msg += ' ' + str(e)
raise argparse.ArgumentError(self, msg)
- if port <= 0 or port > MAX_TIMEOUT:
+ if timeout <= 0 or timeout > MAX_TIMEOUT:
msg = _(
"Value {v!r} for a timeout of {what} must be greater than 0 and less than {max}.")
- msg = msg.format(v=values, what=what, max=(MAX_TIMEOUT + 1))
+ msg = msg.format(v=values, what=self.what, max=(MAX_TIMEOUT + 1))
raise argparse.ArgumentError(self, msg)
- setattr(namespace, self.dest, port)
+ setattr(namespace, self.dest, timeout)
# =============================================================================
import logging
import logging.config
import re
-import copy
+# import copy
import os
import ipaddress
import socket
from .mail_app import MailAppError, BaseMailApplication
-from .pdns_config import PdnsConfigError, PdnsConfiguration, LIBRARY_NAME
+from .pdns_config import PdnsConfiguration
+# from .pdns_config import PdnsConfigError, PdnsConfiguration
from .xlate import XLATOR
self.local_addresses.append(addr)
if not self.cfg:
- msg=_("Configuration not available.")
+ msg = _("Configuration not available.")
raise PpPDNSAppError(msg)
self.eval_instance(instance)
inst_group.add_argument(
'-I', '--inst', '--instance',
- metavar=_("INSTANCE"), choices=envs, dest="inst",
+ metavar=_("INSTANCE"), choices=insts, dest="inst",
help=_(
"Select, which PowerDNS instance to use. Valid values: {v}, "
"default: {d!r}.").format(v=inst_list, d=self.instance),
res['default_pdns_api_servername'] = self.default_pdns_api_servername
res['default_pdns_timeout'] = self.default_pdns_timeout
res['default_pdns_instance'] = self.default_pdns_instance
- res{'valid_pdns_api_instances'] = self.valid_pdns_api_instances
+ res['valid_pdns_api_instances'] = self.valid_pdns_api_instances
res['pdns_api_instances'] = {}
for iname in self.pdns_api_instances.keys():