aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-11-22 11:40:57 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-11-22 11:40:57 +0900
commite7a97f829bd0e9bb5907ae75b0c40f36aaa1977f (patch)
tree0115c8e30a5f460a8147243dc32d204fd364d163
parent842e86619dffe9cbc985d98ec581042ed5dc8ba3 (diff)
downloadascension-e7a97f829bd0e9bb5907ae75b0c40f36aaa1977f.tar.gz
ascension-e7a97f829bd0e9bb5907ae75b0c40f36aaa1977f.zip
counter
-rw-r--r--ascension/ascension.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/ascension/ascension.py b/ascension/ascension.py
index 16ba90d..01cf888 100644
--- a/ascension/ascension.py
+++ b/ascension/ascension.py
@@ -187,12 +187,8 @@ class Ascension():
187 # Replace the records already present in GNS as old ones are not deleted 187 # Replace the records already present in GNS as old ones are not deleted
188 self.logger.debug(payload.record_name + "." + domain + ":\n") 188 self.logger.debug(payload.record_name + "." + domain + ":\n")
189 self.ns_process.stdin.write(payload.record_name + "." + domain + ":\n") 189 self.ns_process.stdin.write(payload.record_name + "." + domain + ":\n")
190 i = 0
191 for r in payload.data: 190 for r in payload.data:
192 flags = "[r{}]".format('p' if not r.is_private else '') 191 flags = "[r{}]".format('p' if not r.is_private else '')
193 i += 1
194 if i > 100:
195 return
196 # FIXME we have many more flags. but probably not in our use 192 # FIXME we have many more flags. but probably not in our use
197 # case? We always have relative expirations, for example. 193 # case? We always have relative expirations, for example.
198 self.logger.debug("{} {} {} {}\n".format(r.record_type, 194 self.logger.debug("{} {} {} {}\n".format(r.record_type,
@@ -231,11 +227,11 @@ class Ascension():
231 self.ns_process = subprocess.Popen(["gnunet-namestore", "-a", "-S"], stdin=subprocess.PIPE, text=True) 227 self.ns_process = subprocess.Popen(["gnunet-namestore", "-a", "-S"], stdin=subprocess.PIPE, text=True)
232 start = time.time() 228 start = time.time()
233 i = 0 229 i = 0
230 setcount = len(self.dnszone.zone.nodes.items()))
234 for name, rdatasets in self.dnszone.zone.nodes.items(): 231 for name, rdatasets in self.dnszone.zone.nodes.items():
235 # log if the rdataset is empty for some reason 232 # log if the rdataset is empty for some reason
236 i += 1 233 i += 1
237 if i > 100: 234 print("Adding records %d/%d\r"%(i,setcount, end="")
238 break
239 if not rdatasets: 235 if not rdatasets:
240 self.logger.warning("Empty Rdataset!") 236 self.logger.warning("Empty Rdataset!")
241 continue 237 continue
@@ -272,10 +268,7 @@ class Ascension():
272 self.logger.info("Added records to /namestore/%s with data %s", domain, record_data) 268 self.logger.info("Added records to /namestore/%s with data %s", domain, record_data)
273 payload = record_data 269 payload = record_data
274 self.ns_process.stdin.write(payload.record_name + "." + domain + ":\n") 270 self.ns_process.stdin.write(payload.record_name + "." + domain + ":\n")
275 i = 0
276 for r in payload.data: 271 for r in payload.data:
277 print("Adding records %d/%d\r"%(i,len(payload.data)), end="")
278 i += 1
279 flags = "[r{}]".format('p' if not r.is_private else '') 272 flags = "[r{}]".format('p' if not r.is_private else '')
280 # FIXME we have many more flags. but probably not in our use 273 # FIXME we have many more flags. but probably not in our use
281 # case? We always have relative expirations, for example. 274 # case? We always have relative expirations, for example.