commit 5a4d88463b7f78ccb2247a44580e7cae27457277 Author: Arturo Filastò art@fuffa.org Date: Thu Aug 7 19:27:43 2014 +0200
Fix bug that lead the collector not being set via the test deck.
If a collector is specified from the command line we should not print a confusing message stating that the collector is being set twice. --- ooni/deck.py | 7 +++---- ooni/oonicli.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/ooni/deck.py b/ooni/deck.py index adf1d69..19c7fd5 100644 --- a/ooni/deck.py +++ b/ooni/deck.py @@ -127,11 +127,10 @@ class Deck(InputFile): log.msg("Skipping...") continue net_test_loader = NetTestLoader(test['options']['subargs'], - test_file=nettest_path) + test_file=nettest_path) + if test['options']['collector']: + net_test_loader.collector = test['options']['collector'] self.insert(net_test_loader) - #XXX: If the deck specifies the collector, we use the specified collector - # And it should also specify the test helper address to use - # net_test_loader.collector = test['options']['collector']
def insert(self, net_test_loader): """ Add a NetTestLoader to this test deck """ diff --git a/ooni/oonicli.py b/ooni/oonicli.py index 77e0a78..d66cf5c 100644 --- a/ooni/oonicli.py +++ b/ooni/oonicli.py @@ -187,6 +187,8 @@ def runWithDirector(logging=True, start_tor=True): test_file = nettest_to_path(global_options['test_file'], True) net_test_loader = NetTestLoader(global_options['subargs'], test_file=test_file) + if global_options['collector']: + net_test_loader.collector = global_options['collector'] deck.insert(net_test_loader) except errors.MissingRequiredOption as option_name: log.err('Missing required option: "%s"' % option_name)
tor-commits@lists.torproject.org