[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [ascension] 03/04: flags adjustment and soa record is now p
From: |
gnunet |
Subject: |
[GNUnet-SVN] [ascension] 03/04: flags adjustment and soa record is now public by default |
Date: |
Wed, 30 Jan 2019 18:52:33 +0100 |
This is an automated email from the git hooks/post-receive script.
rexxnor pushed a commit to branch master
in repository ascension.
commit 009bac34d54b63c0958e82b7bfa871d767ba0153
Author: rexxnor <address@hidden>
AuthorDate: Wed Jan 30 14:29:16 2019 +0100
flags adjustment and soa record is now public by default
---
ascension/ascension.py | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/ascension/ascension.py b/ascension/ascension.py
index 98efb17..4a84de1 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -70,7 +70,7 @@ class Ascender():
Class that provides migration for any given domain
"""
@classmethod
- def __init__(cls, domain, transferns, port):
+ def __init__(cls, domain, transferns, port, flags):
cls.domain = domain
if domain[-1] == '.':
cls.domain = cls.domain[:-1]
@@ -81,6 +81,7 @@ class Ascender():
cls.zone = None
cls.zonegenerator = None
cls.nscache = dict()
+ cls.flags = flags
@classmethod
def initial_zone_transfer(cls, serial=None):
@@ -183,10 +184,9 @@ class Ascender():
logging.warning("zone: %s, current: %s", zoneserial, currentserial)
@classmethod
- def add_records_to_gns(cls, flags="n"):
+ def add_records_to_gns(cls):
"""
Extracts records from zone and adds them to GNS
- :param flags: Flag to set in GNS, defaults to n (no flags)
:raises AttributeError: When getting incomplete data
"""
logging.info("Starting to add records into GNS...")
@@ -252,7 +252,10 @@ class Ascender():
# build recordline
recordline.append("-R")
recordline.append('%d %s %s %s' %
- (int(ttl), rdtype, flags,
element))
+ (int(ttl),
+ rdtype,
+ cls.flags,
+ element))
else:
# build recordline
recordline.append("-R")
@@ -261,7 +264,10 @@ class Ascender():
# list to pass those arguments to prevent quoting
# issues in the future.
recordline.append('%d %s %s %s' %
- (int(ttl), rdtype, flags, value))
+ (int(ttl),
+ rdtype,
+ cls.flags,
+ value))
# add recordline to gns and filter out empty lines
if len(recordline) > 1:
@@ -543,7 +549,9 @@ class Ascender():
int(serial), int(refresh), int(retry),
int(expiry), int(irefresh)
),
- '-e', '%ds' % ttl])
+ '-e', '%ds' % ttl,
+ # maybe don't make it public by default
+ '-p'])
logging.info("executed command: %s", " ".join(ret.args))
if ret.returncode != 0:
logging.warning("failed to add %s record %s", "SOA", "@")
@@ -664,7 +672,7 @@ def main():
sys.exit(1)
# Initialize class instance
- ascender = Ascender(domain, transferns, port)
+ ascender = Ascender(domain, transferns, port, flags)
# Event loop for actual daemon
while 1:
@@ -672,7 +680,7 @@ def main():
ascender.initial_zone_transfer(serial)
ascender.mirror_zone()
ascender.bootstrap_zone()
- ascender.add_records_to_gns(flags=flags)
+ ascender.add_records_to_gns()
logging.info("Finished migrating of the zone %s", ascender.domain)
refresh = int(ascender.get_zone_refresh_time())
retry = int(ascender.get_zone_retry_time())
--
To stop receiving notification emails like this one, please contact
address@hidden