]> mj.ucw.cz Git - pynsc.git/commitdiff
Rename follow_primary to secondary_to
authorMartin Mares <mj@ucw.cz>
Wed, 7 Aug 2024 21:09:53 +0000 (23:09 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 7 Aug 2024 21:09:53 +0000 (23:09 +0200)
TODO
example/__init__.py
nsconfig/core.py

diff --git a/TODO b/TODO
index 7dd0fbf84083c6af7e57372744a893db12e4c23f..51f4125bdedb4565355af168c8226502ca05957e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
 - DNSSEC
 - Logging
 - More records
-- follow_primary -> secondary_to?
index b2b9601bcbe2117364de098eb6a2f2f98cf562c6..c01c23eea457a5d4f7c12336c2d82e661e9eb491 100644 (file)
@@ -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')
index 860aa3655a288c218c1d92d327c71e4e8a7bfd41..3e6e4d5f66ad960a7a045d673103ae8b5c7e3a66 100644 (file)
@@ -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