gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [ascension] branch master updated: fixed persistend bug wit


From: gnunet
Subject: [GNUnet-SVN] [ascension] branch master updated: fixed persistend bug with labels, changed soa adding
Date: Fri, 24 May 2019 13:52:53 +0200

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

rexxnor pushed a commit to branch master
in repository ascension.

The following commit(s) were added to refs/heads/master by this push:
     new 11a548b  fixed persistend bug with labels, changed soa adding
11a548b is described below

commit 11a548b7331d86dfee8f1601f4e077a963773d04
Author: rexxnor <address@hidden>
AuthorDate: Fri May 24 13:43:23 2019 +0200

    fixed persistend bug with labels, changed soa adding
---
 ascension/ascension.py | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/ascension/ascension.py b/ascension/ascension.py
index 7244e6c..5196c6e 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -185,6 +185,7 @@ class Ascender():
                 # define recordline
                 recordline = list()
                 label = ""
+                bestlabel = ""
                 domain = None
 
                 labelrecords = taskqueue.get()
@@ -195,8 +196,10 @@ class Ascender():
                 # execute thing to run on item
                 label, listofrdatasets = labelrecords
                 label = str(label)
+
                 subzones = str(label).split('.')
                 domain = self.domain
+                bestlabel = label
 
                 if len(subzones) > 1:
                     label = subzones[0]
@@ -208,6 +211,7 @@ class Ascender():
                         domain = fqdn
                     elif subzone in self.subzonedict.keys():
                         domain = subzone
+                    bestlabel = label
 
                 for rdataset in listofrdatasets:
                     for record in rdataset:
@@ -239,7 +243,7 @@ class Ascender():
                             self.transform_to_gns_format(record,
                                                          rdtype,
                                                          domain,
-                                                         label)
+                                                         bestlabel)
                         # skip record if value is none
                         if value is None:
                             continue
@@ -514,9 +518,23 @@ class Ascender():
                                                       retry,
                                                       expiry,
                                                       irefresh)
-        recordval = '%s %s %s %s' % (ttl, "SOA", self.flags, str(value))
-        recordline = ['-R', recordval]
-        self.add_recordline_to_gns(recordline, self.domain, str(label))
+        # Deleting old SOA record and ignoring errors
+        sp.run([GNUNET_NAMESTORE_COMMAND,
+                '-d',
+                '-z', self.domain,
+                '-n', str(label),
+                '-t', "SOA",],
+               stderr=sp.DEVNULL)
+        logging.info("Deleted old SOA record")
+        # Adding new SOA record
+        sp.run([GNUNET_NAMESTORE_COMMAND,
+                '-a',
+                '-z', self.domain,
+                '-n', str(label),
+                '-t', "SOA",
+                '-V', value,
+                '-e', "%ss" % str(self.minimum)])
+        logging.info("Added new SOA record")
 
     @staticmethod
     def create_zone_and_get_pkey(zonestring: str) -> str:

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



reply via email to

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