[tor-commits] [ooni-probe/master] Don't look up helpers if we have already specified a helper.

art at torproject.org art at torproject.org
Tue Oct 29 15:58:13 UTC 2013


commit 3a98d6da99cc1474854159c24baada49e65816e4
Author: aagbsn <aagbsn at extc.org>
Date:   Thu Oct 10 15:31:06 2013 +0000

    Don't look up helpers if we have already specified a helper.
    
    Note: we will need to remove the default helpers in ooni's NetTests.
---
 ooni/deck.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ooni/deck.py b/ooni/deck.py
index 98d90e0..7b8a8c4 100644
--- a/ooni/deck.py
+++ b/ooni/deck.py
@@ -3,7 +3,6 @@
 from ooni.nettest import NetTestLoader
 from ooni.settings import config
 from ooni.utils import log
-from ooni.utils.txagentwithsocks import Agent
 from ooni import errors as e
 
 from twisted.internet import reactor, defer
@@ -167,11 +166,15 @@ class Deck(InputFile):
 
             # Only set the collector if the no collector has been specified
             # from the command line or via the test deck.
-            if not net_test_loader.requiredTestHelpers and net_test_loader in requires_collector:
+            if not required_test_helpers and net_test_loader in requires_collector:
                 log.msg("Using the default collector: %s" % response['default']['collector'])
                 net_test_loader.collector = response['default']['collector'].encode('utf-8')
+                continue
 
             for th in net_test_loader.requiredTestHelpers:
+                # Only set helpers which are not already specified
+                if th['name'] not in required_test_helpers:
+                    continue
                 test_helper = response[th['name']]
                 log.msg("Using this helper: %s" % test_helper)
                 th['test_class'].localOptions[th['option']] = test_helper['address']





More information about the tor-commits mailing list