[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Fix legacy deck converter



commit 7a3913cbb5cf0d2f86f19ab848dcaf4189c6ec61
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Fri Jan 13 15:58:47 2017 +0000

    Fix legacy deck converter
---
 ooni/deck/legacy.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ooni/deck/legacy.py b/ooni/deck/legacy.py
index cf0a30ba..83e16a3a 100644
--- a/ooni/deck/legacy.py
+++ b/ooni/deck/legacy.py
@@ -26,6 +26,13 @@ def subargs_to_options(subargs):
 
     return options
 
+boolean_options = [
+    'no-collector',
+    'no-geoip',
+    'no-yamloo',
+    'verbose'
+]
+
 def convert_legacy_deck(deck_data):
     """
     I take a legacy deck list and convert it to the new deck format.
@@ -58,6 +65,8 @@ def convert_legacy_deck(deck_data):
             deck_task["ooni"][name] = value
 
         for name, value in options.items():
+            if name in boolean_options:
+                value = False if value == 0 else True
             deck_task["ooni"][name] = value
 
         new_deck_data["tasks"].append(deck_task)



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