commit 325bfcc0f000808c5528f90d69996ab0a186aa10 Author: Mike Perry mikeperry-git@fscked.org Date: Thu Dec 1 16:56:46 2011 -0800
Fix an exception that can happen with very large bandwidths.
We have a cap+log warn below that we will hit in this case instead of crashing. --- NetworkScanners/BwAuthority/aggregate.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/NetworkScanners/BwAuthority/aggregate.py b/NetworkScanners/BwAuthority/aggregate.py index 46dce2e..19697eb 100755 --- a/NetworkScanners/BwAuthority/aggregate.py +++ b/NetworkScanners/BwAuthority/aggregate.py @@ -345,7 +345,7 @@ def main(argv): ns_list = c.get_network_status() for n in ns_list: if n.bandwidth == None: n.bandwidth = -1 - ns_list.sort(lambda x, y: y.bandwidth - x.bandwidth) + ns_list.sort(lambda x, y: int(y.bandwidth/10000.0 - x.bandwidth/10000.0)) for n in ns_list: if n.bandwidth == -1: n.bandwidth = None got_ns_bw = False