GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit d4929161 authored by juga  's avatar juga
Browse files

fix: v3bwfile: Warn about None bandwidth values

since they are probably due a bug.
parent 88eb7ef5
...@@ -869,6 +869,7 @@ class V3BWLine(object): ...@@ -869,6 +869,7 @@ class V3BWLine(object):
for r in reversed(results): for r in reversed(results):
if r.relay_average_bandwidth is not None: if r.relay_average_bandwidth is not None:
return r.relay_average_bandwidth return r.relay_average_bandwidth
log.warning("Descriptor average bandwidth is None.")
return None return None
@staticmethod @staticmethod
...@@ -877,6 +878,7 @@ class V3BWLine(object): ...@@ -877,6 +878,7 @@ class V3BWLine(object):
for r in reversed(results): for r in reversed(results):
if r.relay_burst_bandwidth is not None: if r.relay_burst_bandwidth is not None:
return r.relay_burst_bandwidth return r.relay_burst_bandwidth
log.warning("Descriptor burst bandwidth is None.")
return None return None
@staticmethod @staticmethod
...@@ -885,6 +887,7 @@ class V3BWLine(object): ...@@ -885,6 +887,7 @@ class V3BWLine(object):
for r in reversed(results): for r in reversed(results):
if r.consensus_bandwidth is not None: if r.consensus_bandwidth is not None:
return r.consensus_bandwidth return r.consensus_bandwidth
log.warning("Consensus bandwidth is None.")
return None return None
@staticmethod @staticmethod
...@@ -893,6 +896,7 @@ class V3BWLine(object): ...@@ -893,6 +896,7 @@ class V3BWLine(object):
for r in reversed(results): for r in reversed(results):
if r.consensus_bandwidth_is_unmeasured is not None: if r.consensus_bandwidth_is_unmeasured is not None:
return r.consensus_bandwidth_is_unmeasured return r.consensus_bandwidth_is_unmeasured
log.warning("Consensus bandwidth is unmeasured is None.")
return None return None
@staticmethod @staticmethod
...@@ -912,6 +916,7 @@ class V3BWLine(object): ...@@ -912,6 +916,7 @@ class V3BWLine(object):
for r in reversed(results): for r in reversed(results):
if r.relay_observed_bandwidth is not None: if r.relay_observed_bandwidth is not None:
return r.relay_observed_bandwidth return r.relay_observed_bandwidth
log.warning("Descriptor observed bandwidth is None.")
return None return None
@property @property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment