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

[tor-commits] [doctor/master] Surface errors when health check fails



commit fc76344d72cf2531c0ef5d44a62f851fd73e29c1
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Apr 28 18:33:31 2018 -0700

    Surface errors when health check fails
    
    Oops, since we iterate it suppresses errors resulting in a pretty unhelpful
    notice...
    
      Traceback (most recent call last):
        File "/srv/doctor.torproject.org/doctor/relay_check.py", line 63, in <module>
          main()
        File "/srv/doctor.torproject.org/doctor/relay_check.py", line 32, in main
          ))[0]
      IndexError: list index out of range
---
 relay_check.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/relay_check.py b/relay_check.py
index 140ca01..36ddefd 100755
--- a/relay_check.py
+++ b/relay_check.py
@@ -27,9 +27,9 @@ RELAY_LINK = 'https://metrics.torproject.org/rs.html#details/%s' % RELAY_FINGERP
 
 def main():
   try:
-    desc = list(stem.descriptor.remote.their_server_descriptor(
+    desc = stem.descriptor.remote.their_server_descriptor(
       endpoints = [stem.ORPort(RELAY_ADDRESS, RELAY_OR_PORT)],
-    ))[0]
+    ).run()[0]
 
     if desc.nickname != RELAY_NAME:
       raise ValueError('Unexpected descriptor:\n\n%s' % desc)

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