]> mj.ucw.cz Git - pynsc.git/commitdiff
Turned NscZone.root into a property
authorMartin Mares <mj@ucw.cz>
Wed, 7 Aug 2024 20:17:05 +0000 (22:17 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 7 Aug 2024 20:17:05 +0000 (22:17 +0200)
Previously, the root node sometimes disappeared (e.g., when deleting
datasets in NscZone.update_soa).

nsconfig/core.py

index e1ca1e9229333ea83e3fe1d1c679c8ef0725fc1d..5ffc534d458d4c1a460ec69fe8c70d7c1c12f0ef 100644 (file)
@@ -270,9 +270,12 @@ class NscZonePrimary(NscZone):
         self.aliases = []
 
         self.zone = dns.zone.Zone(origin=self.name, rdclass=RdataClass.IN)
-        self.root = NscNode(self, "")
         self.update_soa()
 
+    @property
+    def root(self):
+        return NscNode(self, "")
+
     def update_soa(self) -> None:
         conf = self.config
         soa = dns.rdtypes.ANY.SOA.SOA(