[tor-commits] [sbws/master] fix: v3bwfile: Warn about None bandwidth values

juga at torproject.org juga at torproject.org
Mon Jun 29 07:50:39 UTC 2020


commit d4929161a1284b8d1a28abc4ba6d09af61d68853
Author: juga0 <juga at riseup.net>
Date:   Sun May 17 09:46:45 2020 +0000

    fix: v3bwfile: Warn about None bandwidth values
    
    since they are probably due a bug.
---
 sbws/lib/v3bwfile.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index 8c5b9a9..46e6357 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -869,6 +869,7 @@ class V3BWLine(object):
         for r in reversed(results):
             if r.relay_average_bandwidth is not None:
                 return r.relay_average_bandwidth
+        log.warning("Descriptor average bandwidth is None.")
         return None
 
     @staticmethod
@@ -877,6 +878,7 @@ class V3BWLine(object):
         for r in reversed(results):
             if r.relay_burst_bandwidth is not None:
                 return r.relay_burst_bandwidth
+        log.warning("Descriptor burst bandwidth is None.")
         return None
 
     @staticmethod
@@ -885,6 +887,7 @@ class V3BWLine(object):
         for r in reversed(results):
             if r.consensus_bandwidth is not None:
                 return r.consensus_bandwidth
+        log.warning("Consensus bandwidth is None.")
         return None
 
     @staticmethod
@@ -893,6 +896,7 @@ class V3BWLine(object):
         for r in reversed(results):
             if r.consensus_bandwidth_is_unmeasured is not None:
                 return r.consensus_bandwidth_is_unmeasured
+            log.warning("Consensus bandwidth is unmeasured is None.")
         return None
 
     @staticmethod
@@ -912,6 +916,7 @@ class V3BWLine(object):
         for r in reversed(results):
             if r.relay_observed_bandwidth is not None:
                 return r.relay_observed_bandwidth
+        log.warning("Descriptor observed bandwidth is None.")
         return None
 
     @property





More information about the tor-commits mailing list