[tor-commits] [doctor/master] Stacktrace when tor26 lacks authority flag

atagar at torproject.org atagar at torproject.org
Fri Jun 15 19:27:18 UTC 2018


commit a7989448d27fc6272640f2691852e2202d25efc5
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jun 15 12:26:01 2018 -0700

    Stacktrace when tor26 lacks authority flag
    
    Oops, need to be a tad more defensive here...
    
            Traceback (most recent call last):
            File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 976, in <module>
            main()
              File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 258, in main
              issues += run_checks(consensuses, votes)
              File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 352, in run_checks
              issues = checker(latest_consensus, consensuses, votes)
              File "/srv/doctor.torproject.org/doctor/consensus_health_checker.py", line 640, in has_authority_flag
              seen_authorities.remove('tor26')
            KeyError: 'tor26'
---
 consensus_health_checker.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/consensus_health_checker.py b/consensus_health_checker.py
index f152773..5ef660a 100755
--- a/consensus_health_checker.py
+++ b/consensus_health_checker.py
@@ -637,7 +637,8 @@ def has_authority_flag(latest_consensus, consensuses, votes):
     if Flag.AUTHORITY in desc.flags:
       seen_authorities.add(desc.nickname)
 
-  seen_authorities.remove('tor26')
+  if 'tor26' in seen_authorities:
+    seen_authorities.remove('tor26')
 
   known_authorities = set(DIRECTORY_AUTHORITIES.keys())
   missing_authorities = known_authorities.difference(seen_authorities)



More information about the tor-commits mailing list