gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [ascension] 14/45: reworked the incremental zone transfer,


From: gnunet
Subject: [GNUnet-SVN] [ascension] 14/45: reworked the incremental zone transfer, added notice for bind
Date: Fri, 25 Jan 2019 10:02:14 +0100

This is an automated email from the git hooks/post-receive script.

rexxnor pushed a commit to branch master
in repository ascension.

commit 2829a7614d724fb1e2f01f81d9afd0661dd2e553
Author: rexxnor <address@hidden>
AuthorDate: Fri Sep 28 15:05:35 2018 +0200

    reworked the incremental zone transfer, added notice for bind
---
 gnsmigrator/gnsmigrator.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/gnsmigrator/gnsmigrator.py b/gnsmigrator/gnsmigrator.py
index 80881e3..5b4d2e7 100644
--- a/gnsmigrator/gnsmigrator.py
+++ b/gnsmigrator/gnsmigrator.py
@@ -216,8 +216,6 @@ class GNSMigrator():
         """
         Refresh the zone using IXFR and the previous serial as reference
 
-        Returns 0 on unchanged and 1 on changed
-
         :param domain: The domain to transfer and migrate
         :param zonetuple: The necessary data tuple for the transfer
         :param dnsresolver: Optional user specified resolver for subdomains
@@ -229,20 +227,26 @@ class GNSMigrator():
 
         # Ugly way to get serial
         oldserial = int(str(zone.get_rdataset('@', dns.rdatatype.SOA)).split(' 
')[5])
+
+        # A normal BIND9 returns a normal AXFR response with the entire zone
+        # if the serial is newer. This is why there is no real incremental
+        # zone transfer using bind. This makes the merger_zones function
+        # unnecessary. Furthermore this try except block updates only if
+        # there is a newer zone availible (according to serial). The IXFR
+        # returns only a SOA record with a new serial if it has not changed
         try:
             newzone = dns.zone.from_xfr(dns.query.xfr(xfrinfo[0],
                                                       xfrinfo[1],
                                                       
rdtype=dns.rdatatype.IXFR,
                                                       serial=oldserial))
+            cls.zones[domain] = (newzone, (xfrinfo[0],
+                                           xfrinfo[1],
+                                           zone.get_rdataset('@', 
dns.rdatatype.SOA).ttl))
         except dns.zone.NoNS:
             print('the zone for domain %s was not updated' % domain)
 
         # Merge old and new zone
-        updatedzone = cls.merge_zones(domain, zone, newzone)
-        cls.zones[domain] = (updatedzone, (xfrinfo[0],
-                                           xfrinfo[1],
-                                           zone.get_rdataset('@', 
dns.rdatatype.SOA).ttl))
-
+        # updatedzone = cls.merge_zones(domain, zone, newzone)
 
 def main():
     """

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]