]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Update zone.py 363/head
authortmerila <tuomas@merila.org>
Wed, 3 Apr 2019 11:38:25 +0000 (14:38 +0300)
committerGitHub <noreply@github.com>
Wed, 3 Apr 2019 11:38:25 +0000 (14:38 +0300)
Check for self.last_ttl_known before setting ttl = self.last_ttl so it will remain None instead of 0 if value is not known.

dns/zone.py

index 7f5cb60d9ff1b63044d4f63fcc6e5b30a509dcd3..1989d1a7f5d57515796ce077cdd39fea53968cd1 100644 (file)
@@ -671,9 +671,9 @@ class _MasterReader(object):
         except dns.ttl.BadTTL:
             if self.default_ttl_known:
                 ttl = self.default_ttl
-            else:
+            elif self.last_ttl_known:
                 ttl = self.last_ttl
-                
+
         # Class
         try:
             rdclass = dns.rdataclass.from_text(token.value)
@@ -729,7 +729,7 @@ class _MasterReader(object):
                     ttl = self.default_ttl
                 else:
                     ttl = self.last_ttl
-            
+
         rd.choose_relativity(self.zone.origin, self.relativize)
         covers = rd.covers()
         rds = n.find_rdataset(rdclass, rdtype, covers, True)