From: Martin Mares Date: Sat, 20 Apr 2024 23:41:58 +0000 (+0200) Subject: Beautify X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c87764a47a0eefd364b5e29d3defc2de26390edd;p=pynsc.git Beautify --- diff --git a/example/__init__.py b/example/__init__.py index 9808250..6fd7fb5 100644 --- a/example/__init__.py +++ b/example/__init__.py @@ -9,6 +9,6 @@ for rev in ['10.1.0.0/16', '10.2.0.0/16', 'fd12:3456:789a::/48']: rz = nsc.add_zone(reverse_for=rev) rz[""].NS(['ns1.example.org', 'ns2.example.org']) -nsc.add_zone('example.net', secondary_for='10.42.0.1') +nsc.add_zone('example.net', follow_primary='10.42.0.1') import example.example_org diff --git a/nsconfig/core.py b/nsconfig/core.py index f48a5be..b61a02d 100644 --- a/nsconfig/core.py +++ b/nsconfig/core.py @@ -368,7 +368,7 @@ class Nsc: def add_zone(self, name: Optional[str] = None, reverse_for: str | IPNetwork | None = None, - secondary_for: str | IPAddress | None = None, + follow_primary: str | IPAddress | None = None, inherit_config: Optional[NscZoneConfig] = None, **kwargs) -> Zone: if inherit_config is None: @@ -382,12 +382,12 @@ class Nsc: assert name not in self.zones z: NscZone - if secondary_for is None: + if follow_primary is None: z = NscZonePrimary(self, name, reverse_for=reverse_for, inherit_config=inherit_config, **kwargs) else: - if isinstance(secondary_for, str): - secondary_for = ip_address(secondary_for) - z = NscZoneSecondary(self, name, reverse_for=reverse_for, primary_server=secondary_for, inherit_config=inherit_config, **kwargs) + if isinstance(follow_primary, str): + follow_primary = ip_address(follow_primary) + z = NscZoneSecondary(self, name, reverse_for=reverse_for, primary_server=follow_primary, inherit_config=inherit_config, **kwargs) self.zones[name] = z return z