commit 8ee8c8702177a4ba977fedfecb48230a8413f310 Author: Arturo Filastò arturo@filasto.net Date: Tue May 31 18:21:50 2016 +0200
Add option --default-collector to upload reports to a collector that is looked up via the bouncer. --- ooni/report/cli.py | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/ooni/report/cli.py b/ooni/report/cli.py index e52b022..f730027 100644 --- a/ooni/report/cli.py +++ b/ooni/report/cli.py @@ -3,6 +3,7 @@ from __future__ import print_function import os import sys
+from ooni import canonical_bouncer from ooni.report import __version__ from ooni.report import tool from ooni.settings import config @@ -15,6 +16,12 @@ class Options(usage.Options): synopsis = """%s [options] upload | status """ % (os.path.basename(sys.argv[0]),)
+ optFlags = [ + ["default-collector", "d", "Upload the reports to the default " + "collector that is looked up with the " + "canonical bouncer."] + ] + optParameters = [ ["configfile", "f", None, "Specify the configuration file to use."], @@ -64,6 +71,10 @@ def run(): config.global_options = dict(options) config.set_paths() config.read_config_file() + + if options['default-collector']: + options['bouncer'] = canonical_bouncer + if options['command'] == "upload" and options['report_file']: tor_check() return tool.upload(options['report_file'],