gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [ascension] 02/02: added reading of subzonedict from GNS


From: gnunet
Subject: [GNUnet-SVN] [ascension] 02/02: added reading of subzonedict from GNS
Date: Wed, 01 May 2019 21:22:07 +0200

This is an automated email from the git hooks/post-receive script.

rexxnor pushed a commit to branch master
in repository ascension.

commit 4b9ec9a52d9af6061febb06911c53a5d9ca3a0ee
Author: rexxnor <address@hidden>
AuthorDate: Wed May 1 21:19:43 2019 +0200

    added reading of subzonedict from GNS
---
 ascension/ascension.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ascension/ascension.py b/ascension/ascension.py
index 8815d5f..f4ca9b9 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -65,7 +65,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"
+    "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
@@ -75,7 +75,7 @@ OBSOLETE_RECORD_TYPES = [
     "SIG", "KEY",
     "RRSIG", "NSEC", "DNSKEY", "NSEC3", "NSEC3PARAM", "CDNSKEY",
     "TKEY", "TSIG",
-    "TA", "DLV"
+    "TA", "DLV",
 ]
 
 class Ascender():
@@ -500,7 +500,7 @@ class Ascender():
             soa_serial = re.findall(soapattern, serial)[0]
         else:
             soa_serial = 0
-        return soa_serial
+        return int(soa_serial)
 
     @staticmethod
     def get_zone_soa(zone) -> dns.rdatatype.SOA:
@@ -614,6 +614,14 @@ class Ascender():
         """
         domain = self.domain
 
+        # Build Dictionary from GNS identities
+        ids = sp.run([GNUNET_ZONE_CREATION_COMMAND, '-d'], stdout=sp.PIPE)
+        domainlist = ''.join(col for col in ids.stdout.decode()).split('\n')
+        altdomainlist = [e for e in domainlist if domain + " " in e]
+        for zone in altdomainlist:
+            zonename, _, pkey = zone.split(" ")
+            self.subzonedict[zonename] = (pkey, self.minimum)
+
         zonelist = self.subzonedict.items()
         sortedlist = sorted(zonelist, key=lambda s: len(str(s).split('.')))
         for zone, pkeyttltuple in sortedlist:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]