[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [doctor/master] Errors due to the recent is_bandwidth_authority attribute change



commit 50f3601dbdacac0e8f6585c39bda4948df711108
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Nov 22 13:02:44 2014 -0800

    Errors due to the recent is_bandwidth_authority attribute change
    
    Our 'authority' keys are strings, not DirectoryAuthority instances...
    
      Traceback (most recent call last):
        File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 754, in <module>
          main()
        File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 238, in main
          issues += run_checks(consensuses, votes)
        File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 329, in run_checks
          issues = checker(latest_consensus, consensuses, votes)
        File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 541, in voting_bandwidth_scanners
          if authority.is_bandwidth_authority and not contains_measured_bandwidth:
      AttributeError: 'str' object has no attribute 'is_bandwidth_authority'
---
 consensus_health_checker.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index 794661f..f8134bc 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -538,9 +538,9 @@ def voting_bandwidth_scanners(latest_consensus, consensuses, votes):
         contains_measured_bandwidth = True
         break
 
-    if authority.is_bandwidth_authority and not contains_measured_bandwidth:
+    if DIRECTORY_AUTHORITIES[authority].is_bandwidth_authority and not contains_measured_bandwidth:
       missing_authorities.append(authority)
-    if not authority.is_bandwidth_authority and contains_measured_bandwidth:
+    if not DIRECTORY_AUTHORITIES[authority].is_bandwidth_authority and contains_measured_bandwidth:
       extra_authorities.append(authority)
 
   issues = []
@@ -562,7 +562,7 @@ def unmeasured_relays(latest_consensus, consensuses, votes):
   consensus_fingerprints = set([desc.fingerprint for desc in latest_consensus.routers.values()])
 
   for authority, vote in votes.items():
-    if authority.is_bandwidth_authority:
+    if DIRECTORY_AUTHORITIES[authority].is_bandwidth_authority:
       measured, unmeasured = 0, 0
 
       for desc in vote.routers.values():

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits