[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 23/57: fixed non existing file
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 23/57: fixed non existing file |
Date: |
Sat, 13 Apr 2019 13:32:20 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository ascension.
commit ef5106902865aecc21998731b8237ab168e9e1ce
Author: rexxnor <address@hidden>
AuthorDate: Sun Oct 14 00:13:18 2018 +0200
fixed non existing file
---
gnsmigrator/gnsmigrator.py | 38 ++++++++++++++------------------------
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/gnsmigrator/gnsmigrator.py b/gnsmigrator/gnsmigrator.py
index 0bc497f..3fa3ba4 100644
--- a/gnsmigrator/gnsmigrator.py
+++ b/gnsmigrator/gnsmigrator.py
@@ -394,27 +394,12 @@ class BaseMigrator():
return domain.split('.')[0]
@staticmethod
- def get_current_serial(zonename):
+ def get_current_serial(domain):
"""
- Extracts the current serial from a given zone
+ Gets the current serial for a given zone
"""
- if zonename[-1] == '.':
- zonename = zonename[:-1]
- try:
- serial = sp.check_output([GNUNET_GNS_COMMAND,
- '-t', 'SOA',
- '-u', '@.%s' % zonename])
- except sp.CalledProcessError:
- soa_serial = 0
- return soa_serial
- serial = serial.decode()
- soapattern = re.compile(r'.+\s(\d+),\d+,+\d+,\d+,\d+', re.M)
- if re.findall(soapattern, serial):
- soa_serial = re.findall(soapattern, serial)[0]
- else:
- soa_serial = 0
- return soa_serial
-
+ soa_answer = dns.resolver.query(domain, 'SOA')
+ return soa_answer[0].serial
class ZoneMigrator(BaseMigrator):
"""
@@ -437,7 +422,7 @@ class TLDMigrator(BaseMigrator):
cls.zonegenerator = {}
@classmethod
- def initial_zone_transfer(cls, serial):
+ def initial_zone_transfer(cls, serial=None):
"""
Transfer and initialize the zone
"""
@@ -479,24 +464,29 @@ class TLDMigrator(BaseMigrator):
print(filenotfound)
currentserial = cls.get_current_serial(cls.tld)
- zoneserial = None
+ zoneserial = 0
if zone:
for record in zone.iterate_rdatas(rdtype=dns.rdatatype.SOA):
zoneserial = str(record[2]).split(' ')[2].split(',')[0]
break
else:
- if currentserial != zoneserial:
+ if zoneserial == 0:
+ cls.initial_zone_transfer()
+ if zoneserial < currentserial:
cls.transfer_zone()
+
# zip and pickle the zone
with gzip.open('%s.zone.gz' % cls.tld[:-1], 'wb') as zonefile:
pickle.dump(zone, zonefile)
@classmethod
def transfer_zone(cls, zone_factory=dns.zone.Zone,
- relativize=True, check_origin=True):
+ relativize=True, check_origin=True
+ ):
"""
Do the actual zone transfer
"""
+ zone = None
try:
for message in cls.zonegenerator:
origin = message.origin
@@ -542,7 +532,7 @@ class TLDMigrator(BaseMigrator):
if record is None:
break
# execute thing to run on item
- dnsname, ttl, authns = record
+ _, _, authns = record
if str(authns)[:-1] == ".":
authns = str(authns)[:-1]
else:
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [ascension] 36/57: some experimental fixes, (continued)
- [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
- [GNUnet-SVN] [ascension] 02/57: Added LICENSE, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 18/57: refactored adding of records, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 08/57: added GNS2DNS support and rudimentary Unittests (incomplete), gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 23/57: fixed non existing file,
gnunet <=
- [GNUnet-SVN] [ascension] 42/57: added dnscurve detection and log it, fix ttl bug with hierarchy, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 07/57: fixes, added a few tests, updated README and requirements, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 10/57: added incremental zone transfer logic, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 54/57: lint manpage, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 39/57: added daemonization, bumped version, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 57/57: ascension.1: remove texinfo syntax, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 49/57: minor cleanup, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 51/57: removed daemonization, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 26/57: added definitive support for IXFR, gnunet, 2019/04/13
- [GNUnet-SVN] [ascension] 37/57: updated README, gnunet, 2019/04/13