summaryrefslogtreecommitdiff
path: root/scripts/maint/updateFallbackDirs.py
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2019-01-07 11:09:33 +0200
committerNick Mathewson <nickm@torproject.org>2019-01-15 08:25:29 -0500
commit7fbe7a256383eebae35c8eec31fe88807c82d394 (patch)
tree00c8c65d6402ff4169eaf82ae9c72233d3e48422 /scripts/maint/updateFallbackDirs.py
parent41e3c760a400b9df0ec7d303369b6ce8a3c3993c (diff)
downloadtor-7fbe7a256383eebae35c8eec31fe88807c82d394.tar.gz
tor-7fbe7a256383eebae35c8eec31fe88807c82d394.zip
In updateFallbackDirs.py, say 'fallback list' instead of 'whitelist'
Diffstat (limited to 'scripts/maint/updateFallbackDirs.py')
-rwxr-xr-xscripts/maint/updateFallbackDirs.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
index 14372d0e83..e93db7ab3f 100755
--- a/scripts/maint/updateFallbackDirs.py
+++ b/scripts/maint/updateFallbackDirs.py
@@ -1594,7 +1594,7 @@ class CandidateList(dict):
""" Apply the fallback whitelist_obj to this fallback list,
passing exact to is_in_whitelist(). """
excluded_count = 0
- logging.debug('Applying whitelist')
+ logging.debug('Applying fallback list')
# parse the whitelist
whitelist = self.load_relaylist(whitelist_obj)
filtered_fallbacks = []
@@ -1609,14 +1609,18 @@ class CandidateList(dict):
else:
# exclude
excluded_count += 1
- log_excluded('Excluding %s: not in whitelist.',
+ log_excluded('Excluding %s: not in fallback list.',
f._fpr)
self.fallbacks = filtered_fallbacks
return excluded_count
@staticmethod
- def summarise_filters(initial_count, excluded_count):
- return '/* Whitelist excluded %d of %d candidates. */'%(
+ def summarise_filters(initial_count, excluded_count, check_existing):
+ list_type = 'Whitelist'
+ if check_existing:
+ list_type = 'Fallback list'
+
+ return '/* %s excluded %d of %d candidates. */'%(list_type,
excluded_count, initial_count)
# calculate each fallback's measured bandwidth based on the median
@@ -2284,7 +2288,8 @@ def list_fallbacks(whitelist, exact=False):
# instead, there will be an info-level log during the eligibility check.
initial_count = len(candidates.fallbacks)
excluded_count = candidates.apply_filter_lists(whitelist, exact=exact)
- print candidates.summarise_filters(initial_count, excluded_count)
+ print candidates.summarise_filters(initial_count, excluded_count,
+ whitelist['check_existing'])
eligible_count = len(candidates.fallbacks)
# calculate the measured bandwidth of each relay,