commit 55f669dac35c3f86f2a24d67e0e9d899b75c73c8 Author: Isis Lovecruft isis@torproject.org Date: Wed Jun 11 20:15:21 2014 +0000
Support requiring distribution of bridges with the "Running" flag.
* CHANGE bridgedb.Bridges.BridgeRingParameters class to support using the FORCE_FLAGS config setting to require some N of bridges distributed to have the "Running" flag. --- bridgedb.conf | 8 ++++++-- lib/bridgedb/Bridges.py | 6 +----- 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bridgedb.conf b/bridgedb.conf index a1d6c59..c8c0de1 100644 --- a/bridgedb.conf +++ b/bridgedb.conf @@ -20,9 +20,12 @@ # # CHANGELOG: # ~~~~~~~~~~ -# Changes in version 0.0.10 - 2014-07-06 +# Changes in version 0.0.11 - 2014-07-06 # * ADD EMAIL_BLACKLIST and EMAIL_FUZZY_MATCH settings. # +# Changes in version 0.0.10 - 2014-06-06 +# * Support requiring distribution of bridges with the "Running" flag. +# # Changes in version 0.0.9 - 2014-06-06 # * ADD EMAIL_WHITELIST setting. # @@ -196,7 +199,8 @@ N_IP_CLUSTERS = 4 FORCE_PORTS = [(443, 1)]
# If possible, always give a certain number of answers with a given flag. -# Only "Stable" is now supported. This is a list of (flag,minimum) tuples. +# Both "Running" and "Stable" are supported. +# This is a list of (flag,minimum) tuples. FORCE_FLAGS = [("Stable", 1)]
# Only consider routers whose purpose matches this string. diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index d159b64..fa9c246 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -755,10 +755,6 @@ class BridgeRingParameters(object): """Control the creation of subrings by including a minimum number of bridges which possess certain attributes.
- XXX In bridgedb.conf, there is a note on the FORCE_FLAGS setting which - reads: "Only 'stable' is now supported." Is this still the case? - Why? - :type needPorts: iterable :param needPorts: An iterable of two-tuples. Each two tuple should contain ``(port, minimum)``, where ``port`` is an integer @@ -782,7 +778,7 @@ class BridgeRingParameters(object): raise TypeError("Count %s out of range." % count) for flag, count in needFlags: flag = flag.lower() - if flag not in ["stable",]: + if flag not in ["stable", "running",]: raise TypeError("Unsupported flag %s" % flag) if count <= 0: raise TypeError("Count %s out of range." % count)