ascension

Migrate DNS zones to the GNU Name System
Log | Files | Refs | README | LICENSE

commit 466482c5e2dff6758727844e1b62784fa0504bb4
parent a894729f17ada588eed4e696720fe42f83c35443
Author: rexxnor <rexxnor+gnunet@brief.li>
Date:   Thu, 23 May 2019 19:13:13 +0200

added less verbosity with errors

Diffstat:
Mascension/ascension.py | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ascension/ascension.py b/ascension/ascension.py @@ -67,7 +67,7 @@ GNUNET_ARM_COMMAND = 'gnunet-arm' # in this list and not in the OBSOLETE_RECORD_TYPES list will # create a warning (information loss during migration). SUPPORTED_RECORD_TYPES = [ - "A", "AAAA", "NS", "MX", "SRV", "TXT", "CNAME", "SOA" + "A", "AAAA", "NS", "MX", "SRV", "TXT", "CNAME" ] # Record types that exist in DNS but that won't ever exist in GNS # as they are not needed anymore (so we should not create a warning @@ -194,6 +194,7 @@ class Ascender(): # execute thing to run on item label, listofrdatasets = labelrecords + label = str(label) subzones = str(label).split('.') domain = self.domain @@ -570,12 +571,14 @@ class Ascender(): '-a', '-n', label, '-t', 'PKEY', '-V', pkey, - '-e', "%ss" % ttl]) + '-e', "%ss" % ttl], + stdout=sp.DEVNULL, + stderr=sp.DEVNULL) logging.info("executed command: %s", debug) if ret.returncode != 0: # FIXME: extend gnunet-namestore to return *specific* error code for # "record already exists", and in that case reduce log level to DEBUG here. - logging.warning("failed to add PKEY record %s to %s", + logging.info("failed to add PKEY record %s to %s", label, domain) #logging.warning("PKEY record %s already exists in %s", label, domain) @@ -643,6 +646,10 @@ class Ascender(): for zone, pkeyttltuple in self.subzonedict.items(): pkey, ttl = pkeyttltuple domain = ".".join(zone.split('.')[1::]) + # This happens if root is reached + if domain == '': + logging.info("Reached domain root") + continue label = zone.split('.')[0] logging.info("adding zone %s with %s pkey into %s", zone, pkey, domain) self.add_pkey_record_to_zone(pkey, domain, label, ttl)