From 5440a34b3275d10240a6b3b1282aa28e77c26f95 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 31 Mar 2022 11:34:23 +0200 Subject: [PATCH] Fixing lib/pp_admintools/dns_deploy_zones_config.py --- lib/pp_admintools/dns_deploy_zones_config.py | 38 +++++++++----------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/lib/pp_admintools/dns_deploy_zones_config.py b/lib/pp_admintools/dns_deploy_zones_config.py index 3003f2a..006a07e 100644 --- a/lib/pp_admintools/dns_deploy_zones_config.py +++ b/lib/pp_admintools/dns_deploy_zones_config.py @@ -26,15 +26,12 @@ from fb_tools.common import is_sequence, pp, to_bool # from .config import ConfigError, BaseConfiguration from fb_tools.multi_config import DEFAULT_ENCODING -from . import __version__ as GLOBAL_VERSION -from . import MAX_TIMEOUT, MAX_PORT_NUMBER - from .pdns_config import PdnsConfigError, PdnsConfiguration from .mail_config import DEFAULT_CONFIG_DIR from .xlate import XLATOR -__version__ = '0.1.0' +__version__ = '0.1.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -312,16 +309,15 @@ class DnsDeployZonesConfig(PdnsConfiguration): return set() return addr_list - # ------------------------------------------------------------------------- - def _eval_named_rndc(self, iname, section): + def _eval_named_rndc(self, iname, key, section): val = section[key].strip() if not val: return path = Path(val) - if not path.is_absolute() + if not path.is_absolute(): msg = _("The path to {what} must be an absolute path, found {path!r}.") msg = msg.format(what='rndc', path=val) if self.raise_on_error: @@ -337,14 +333,14 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.rndc = path # ------------------------------------------------------------------------- - def _eval_named_systemctl(self, iname, section): + def _eval_named_systemctl(self, iname, key, section): val = section[key].strip() if not val: return path = Path(val) - if not path.is_absolute() + if not path.is_absolute(): msg = _("The path to {what} must be an absolute path, found {path!r}.") msg = msg.format(what='systemctl', path=val) if self.raise_on_error: @@ -360,7 +356,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.systemctl = path # ------------------------------------------------------------------------- - def _eval_named_configdir(self, iname, section): + def _eval_named_configdir(self, iname, key, section): val = section[key].strip() if not val: @@ -369,7 +365,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): what = _("the named config directory") path = Path(val) - if not path.is_absolute() + if not path.is_absolute(): msg = _("The path to {what} must be an absolute path, found {path!r}.") msg = msg.format(what=what, path=val) if self.raise_on_error: @@ -385,7 +381,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_config_dir = path # ------------------------------------------------------------------------- - def _eval_named_configfile(self, iname, section): + def _eval_named_configfile(self, iname, key, section): val = section[key].strip() if not val: @@ -394,7 +390,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): what = _("the named config file for zones") path = Path(val) - if path.is_absolute() + if path.is_absolute(): msg = _("The path to {what} must not be an absolute path, found {path!r}.") msg = msg.format(what=what, path=val) if self.raise_on_error: @@ -410,7 +406,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_zones_cfg_file = path # ------------------------------------------------------------------------- - def _eval_named_basedir(self, iname, section): + def _eval_named_basedir(self, iname, key, section): val = section[key].strip() if not val: @@ -418,7 +414,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): what = _("the named base directory") path = Path(val) - if not path.is_absolute() + if not path.is_absolute(): msg = _("The path to {what} must be an absolute path, found {path!r}.") msg = msg.format(what=what, path=val) if self.raise_on_error: @@ -434,7 +430,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_basedir = path # ------------------------------------------------------------------------- - def _eval_named_slavedir(self, iname, section): + def _eval_named_slavedir(self, iname, key, section): val = section[key].strip() if not val: @@ -443,7 +439,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): what = _("the directory for slave zones of named") path = Path(val) - if path.is_absolute() + if path.is_absolute(): msg = _("The path to {what} must not be an absolute path, found {path!r}.") msg = msg.format(what=what, path=val) if self.raise_on_error: @@ -459,7 +455,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_slavedir = path # ------------------------------------------------------------------------- - def _eval_named_checkconf(self, iname, section): + def _eval_named_checkconf(self, iname, key, section): val = section[key].strip() if not val: @@ -467,7 +463,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): what = "named-checkconf" path = Path(val) - if not path.is_absolute() + if not path.is_absolute(): msg = _("The path to {what} must be an absolute path, found {path!r}.") msg = msg.format(what=what, path=val) if self.raise_on_error: @@ -483,7 +479,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_checkconf = path # ------------------------------------------------------------------------- - def _eval_named_internal(self, iname, section): + def _eval_named_internal(self, iname, key, section): val = section[key] if val is None: @@ -492,7 +488,7 @@ class DnsDeployZonesConfig(PdnsConfiguration): self.named_internal = val # ------------------------------------------------------------------------- - def _eval_named_listen_v6(self, iname, section): + def _eval_named_listen_v6(self, iname, key, section): val = section[key] if val is None: -- 2.39.5