[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Check for system-wide configuration
commit eee11a20b89c64c1c8376b72f498c0a337bf10ba
Author: aagbsn <aagbsn@xxxxxxxx>
Date: Sun Oct 26 12:22:12 2014 +0000
Check for system-wide configuration
---
ooni/resources/__init__.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/ooni/resources/__init__.py b/ooni/resources/__init__.py
index a59ea2f..748381a 100644
--- a/ooni/resources/__init__.py
+++ b/ooni/resources/__init__.py
@@ -1,9 +1,16 @@
+import os
+
from ooni.settings import config
from ooni.utils import unzip, gunzip
from ooni.deckgen.processors import citizenlab_test_lists
from ooni.deckgen.processors import namebench_dns_servers
+# Use the system configuration if no user configuration exists
+if not os.path.isfile(config.config_file) \
+ and os.path.isfile('/etc/ooniprobe.conf'):
+ config.global_options['configfile'] = '/etc/ooniprobe.conf'
+ config.set_paths(ooni_home=config.advanced.data_dir)
config.read_config_file()
__version__ = "0.0.1"
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits