commit 65ea56a1f7ed97466b3039197b944bd24b86fac8
Author: Arturo Filastò <art...@filasto.net>
Date:   Thu Oct 27 22:54:23 2016 +0200

    When ooniprobe is run for the first time. Initialize it and then run the 
command the user wanted.
    
    This fixes: https://github.com/TheTorProject/ooni-probe/issues/650
---
 ooni/ui/cli.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ooni/ui/cli.py b/ooni/ui/cli.py
index edb97b3..fed9606 100644
--- a/ooni/ui/cli.py
+++ b/ooni/ui/cli.py
@@ -224,18 +224,13 @@ def initializeOoniprobe(global_options):
                               should_upload=should_upload,
                               preferred_backend=preferred_backend)
     config.set_initialized()
+    print("ooniprobe is now initialized. You can begin using it!")
 
 def setupGlobalOptions(logging, start_tor, check_incoherences):
     global_options = parseOptions()
 
     config.global_options = global_options
 
-    if not config.is_initialized():
-        log.err("You first need to agree to the informed consent and setup "
-                "ooniprobe to run it.")
-        global_options['initialize'] = True
-        return global_options
-
     config.set_paths()
     config.initialize_ooni_home()
     try:
@@ -243,6 +238,9 @@ def setupGlobalOptions(logging, start_tor, 
check_incoherences):
     except errors.ConfigFileIncoherent:
         sys.exit(6)
 
+    if not config.is_initialized():
+        initializeOoniprobe(global_options)
+
     if global_options['verbose']:
         config.advanced.debug = True
 



_______________________________________________
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits

Reply via email to