From: Martin Mares Date: Wed, 7 Aug 2024 21:09:53 +0000 (+0200) Subject: Rename follow_primary to secondary_to X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8d5a5c96a7f120645b08acfa47881c728ef56d7c;p=pynsc.git Rename follow_primary to secondary_to --- diff --git a/TODO b/TODO index 7dd0fbf..51f4125 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ - DNSSEC - Logging - More records -- follow_primary -> secondary_to? diff --git a/example/__init__.py b/example/__init__.py index b2b9601..c01c23e 100644 --- a/example/__init__.py +++ b/example/__init__.py @@ -15,7 +15,7 @@ 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.root.NS('ns1.example.org', 'ns2.example.org') -nsc.add_zone('example.net', follow_primary='10.42.0.1') +nsc.add_zone('example.net', secondary_to='10.42.0.1') rz = nsc.add_zone(reverse_for='10.3.0.0/16') rz.delegate_classless('10.3.16.0/20').NS('ns1.example.org') diff --git a/nsconfig/core.py b/nsconfig/core.py index 860aa36..3e6e4d5 100644 --- a/nsconfig/core.py +++ b/nsconfig/core.py @@ -489,7 +489,7 @@ class Nsc: *, reverse_for: str | IPNetwork | None = None, alias_for: Optional[NscZonePrimary] = None, - follow_primary: str | IPAddress | None = None, + secondary_to: str | IPAddress | None = None, inherit_config: Optional[NscZoneConfig] = None, **kwargs) -> Zone: if inherit_config is None: @@ -504,14 +504,14 @@ class Nsc: z: NscZone if alias_for is not None: - assert follow_primary is None + assert secondary_to is None z = NscZoneAlias(self, name, reverse_for=reverse_for, alias_for=alias_for, inherit_config=inherit_config, **kwargs) - elif follow_primary is None: + elif secondary_to is None: z = NscZonePrimary(self, name, reverse_for=reverse_for, inherit_config=inherit_config, **kwargs) else: - 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) + if isinstance(secondary_to, str): + secondary_to = ip_address(secondary_to) + z = NscZoneSecondary(self, name, reverse_for=reverse_for, primary_server=secondary_to, inherit_config=inherit_config, **kwargs) self.zones[name] = z return z