commit 5c0bc06f915afbef7a908910ac83a00081063875 Author: Arturo Filastò art@fuffa.org Date: Mon Aug 18 17:33:53 2014 +0200
Don't start tor if no collector option is specified and no test helper is needed. --- ooni/deck.py | 6 ++++-- ooni/oonicli.py | 4 +--- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/ooni/deck.py b/ooni/deck.py index 3f64064..889e17e 100644 --- a/ooni/deck.py +++ b/ooni/deck.py @@ -90,9 +90,11 @@ def nettest_to_path(path, allow_arbitrary_paths=False): class Deck(InputFile): def __init__(self, deck_hash=None, deckFile=None, - decks_directory=config.decks_directory): + decks_directory=config.decks_directory, + no_collector=False): self.id = deck_hash self.requiresTor = False + self.no_collector = no_collector self.bouncer = '' self.netTestLoaders = [] self.inputs = [] @@ -169,7 +171,7 @@ class Deck(InputFile): required_test_helpers = [] requires_collector = [] for net_test_loader in self.netTestLoaders: - if not net_test_loader.collector: + if not net_test_loader.collector and not self.no_collector: requires_collector.append(net_test_loader)
for th in net_test_loader.requiredTestHelpers: diff --git a/ooni/oonicli.py b/ooni/oonicli.py index fdb202d..be242f5 100644 --- a/ooni/oonicli.py +++ b/ooni/oonicli.py @@ -169,11 +169,9 @@ def runWithDirector(logging=True, start_tor=True, check_incoherences=True): log.msg("Not reporting using a collector") global_options['collector'] = None
- deck = Deck() + deck = Deck(no_collector=global_options['no-collector']) deck.bouncer = global_options['bouncer'] start_tor = False - if global_options['bouncer']: - start_tor |= True if global_options['collector']: start_tor |= True