[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 11/57: added ttl of SOA to zone for later imple
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 11/57: added ttl of SOA to zone for later implementation of timer |
Date: |
Sat, 13 Apr 2019 13:32:08 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository ascension.
commit af1af4396128b96c2ae08c347db33281ae70ea98
Author: rexxnor <address@hidden>
AuthorDate: Fri Sep 28 08:29:04 2018 +0200
added ttl of SOA to zone for later implementation of timer
---
gnsmigrator/gnsmigrator.py | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/gnsmigrator/gnsmigrator.py b/gnsmigrator/gnsmigrator.py
index c09f945..0329f1e 100644
--- a/gnsmigrator/gnsmigrator.py
+++ b/gnsmigrator/gnsmigrator.py
@@ -63,7 +63,9 @@ class GNSMigrator():
except dns.exception.FormError:
print("domain '%s' does not allow xfr requests" % domain)
continue
- cls.zones[domain] = (zone, (master_answer[0].address, domain))
+ cls.zones[domain] = (zone, (master_answer[0].address,
+ domain,
+ zone.get_rdataset('@',
dns.rdatatype.SOA).ttl))
@classmethod
def bootstrap_zones(cls):
@@ -217,9 +219,16 @@ class GNSMigrator():
xfrinfo[1],
rdtype=dns.rdatatype.IXFR,
serial=serial))
- if newzone == zone:
- return 1
- return 0
+
+ # If the zone serials match, refresh the TTL in the daemon, else
insert new TTL
+ newserial = int(str(newzone.get_rdataset('@',
dns.rdatatype.SOA)).split(' ')[5])
+ if serial == newserial:
+ cls.zones[domain] = (zone, (xfrinfo[0],
+ xfrinfo[1],
+ newzone.get_rdataset('@',
dns.rdatatype.SOA).ttl))
+ cls.zones[domain] = (newzone, (xfrinfo[0],
+ xfrinfo[1],
+ newzone.get_rdataset('@',
dns.rdatatype.SOA).ttl))
def main():
@@ -259,6 +268,8 @@ def main():
gnsmigrator.bootstrap_zones()
gnsmigrator.initial_zone_transfer()
+
+ # TODO add a daemon for doing this and notify when the TTL has expired
for domain, zonetuple in gnsmigrator.zones.items():
# Returns a value 0 if not changed and 1 if changed
gnsmigrator.refresh_zone(domain, zonetuple, dnsresolver)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [ascension] branch master created (now e08203d), gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 01/57: added gitignore and README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 04/57: Merge branch 'master' of gitlab.ti.bfh.ch:gerbp6/gnsmigrator, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 03/57: removed GNU from heading in README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 09/57: updated README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 06/57: working prototype for A, AAAA, MX, CNAME, TXT and more records, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 20/57: fixed zonemaster to zonedata in README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 12/57: bumped version to 0.1.0, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 16/57: fixed special cases with GNS2DNS, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 14/57: reworked the incremental zone transfer, added notice for bind, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 11/57: added ttl of SOA to zone for later implementation of timer,
gnunet <=
- [GNUnet-SVN] [ascension] 05/57: initial prototype, bootstrapping zones and zone transfer, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 24/57: fixed zone serialisation, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 17/57: updated requirements and README, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 36/57: some experimental fixes, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 19/57: fixed some minor bugs, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 15/57: created baseclass and separated small from big zones, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 21/57: fixed serial fetching and added serialization of zone, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 13/57: added zone merging of full and incremental zones, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 29/57: added warnings to logging if records failed to be added, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 27/57: unstable version, port specification possible, gnunet, 2019/04/13