[tor-commits] [sbws/master] Return trimmed results only when arg is True
pastly at torproject.org
pastly at torproject.org
Tue Jun 26 15:36:50 UTC 2018
commit b2c60d0d6d4a37a75a864e8127e8761835b3f41a
Author: juga0 <juga at riseup.net>
Date: Wed Jun 20 07:53:19 2018 +0000
Return trimmed results only when arg is True
---
sbws/lib/resultdump.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index 31a8926..aab27e7 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -96,7 +96,6 @@ def trim_results_ip_changed(result_dict, on_changed_ipv4=False,
:returns: a new results dictionary
"""
assert isinstance(result_dict, dict)
- assert on_changed_ipv4 is True or on_changed_ipv6 is True
new_results_dict = {}
if on_changed_ipv4 is True:
for fp in result_dict.keys():
@@ -115,10 +114,11 @@ def trim_results_ip_changed(result_dict, on_changed_ipv4=False,
new_results_dict[fp] = last_ip_results
else:
new_results_dict[fp] = results
+ return new_results_dict
if on_changed_ipv6 is True:
log.warn("Reseting bandwidth results when IPv6 changes,"
" is not yet implemented.")
- return new_results_dict
+ return result_dict
def load_recent_results_in_datadir(fresh_days, datadir, success_only=False,
More information about the tor-commits
mailing list