[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [doctor/master] Descriptor checker didn't account for stem authority changes
commit bf8947c09b1d7ecb49235cdd19806fc0e9c85636
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Thu Sep 5 09:07:55 2013 -0700
Descriptor checker didn't account for stem authority changes
I expanded the information stem provides reguarding directory authorities and
updates our other scripts to take advantage of it, but forgot
descriptor_checker.py. As a result the script errors out when it comes time to
download the consensus from each authority.
---
descriptor_checker.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/descriptor_checker.py b/descriptor_checker.py
index 3aa278d..ad907d4 100755
--- a/descriptor_checker.py
+++ b/descriptor_checker.py
@@ -58,14 +58,18 @@ def main():
# download the consensus from each authority
- for authority, endpoint in stem.descriptor.remote.DIRECTORY_AUTHORITIES.items():
- log.debug("Downloading the consensus from %s..." % authority)
+ for authority in stem.descriptor.remote.get_authorities().values():
+ # skip authorities that don't vote in the consensus
+ if authority.v3ident is None:
+ continue
+
+ log.debug("Downloading the consensus from %s..." % authority.nickname)
query = stem.descriptor.remote.Query(
'/tor/status-vote/current/consensus',
block = True,
timeout = 60,
- endpoints = [endpoint],
+ endpoints = [(authority.address, authority.dir_port)],
document_handler = stem.descriptor.DocumentHandler.DOCUMENT,
)
@@ -73,9 +77,9 @@ def main():
count = len(list(query)[0].routers)
log.debug(" %i descriptors retrieved from %s in %0.2fs" % (count, query.download_url, query.runtime))
else:
- log.warn("Unable to retrieve the consensus from %s: %s" % (authority, query.error))
+ log.warn("Unable to retrieve the consensus from %s: %s" % (authority.nickname, query.error))
- subject = EMAIL_SUBJECT + ' (%s)' % authority
+ subject = EMAIL_SUBJECT + ' (%s)' % authority.nickname
send_email(subject, 'consensus', query)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits