[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 23/45: fixed non existing file
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 23/45: fixed non existing file |
Date: |
Fri, 25 Jan 2019 10:02:23 +0100 |
This is an automated email from the git hooks/post-receive script.
rexxnor 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] branch master created (now 5ea0f07), gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 04/45: Merge branch 'master' of gitlab.ti.bfh.ch:gerbp6/gnsmigrator, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 01/45: added gitignore and README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 07/45: fixes, added a few tests, updated README and requirements, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 14/45: reworked the incremental zone transfer, added notice for bind, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 11/45: added ttl of SOA to zone for later implementation of timer, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 09/45: updated README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 23/45: fixed non existing file,
gnunet <=
- [GNUnet-SVN] [ascension] 19/45: fixed some minor bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 16/45: fixed special cases with GNS2DNS, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 25/45: fixed bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 20/45: fixed zonemaster to zonedata in README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 13/45: added zone merging of full and incremental zones, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 05/45: initial prototype, bootstrapping zones and zone transfer, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 17/45: updated requirements and README, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 22/45: finished refactoring, fixed a few bugs, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 10/45: added incremental zone transfer logic, gnunet, 2019/01/25
- [GNUnet-SVN] [ascension] 06/45: working prototype for A, AAAA, MX, CNAME, TXT and more records, gnunet, 2019/01/25