]> mj.ucw.cz Git - pynsc.git/commitdiff
Beautify
authorMartin Mares <mj@ucw.cz>
Sat, 20 Apr 2024 23:41:58 +0000 (01:41 +0200)
committerMartin Mares <mj@ucw.cz>
Sat, 20 Apr 2024 23:41:58 +0000 (01:41 +0200)
example/__init__.py
nsconfig/core.py

index 980825075e08d718cc6175f7456196476b942321..6fd7fb5ecc3af08d1a50a0a27d623e53cbdf2cb4 100644 (file)
@@ -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
index f48a5be4780ac3edf02cf3ea45fb6ca3f65b2049..b61a02d36f181d2826740df6f257f25fa12c0faf 100644 (file)
@@ -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