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

[tor-commits] [ooni-probe/master] Add support for specifying a settings.ini file via environment variables



commit ee68602abac9c5f66ba81c4df95822a3ccd87bda
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Wed Oct 26 17:12:03 2016 +0200

    Add support for specifying a settings.ini file via environment variables
    
    When doing end to end testing for the homebrew package it's required to have
    the ability to overwrite the paths used by ooniprobe.
---
 ooni/settings.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ooni/settings.py b/ooni/settings.py
index ef220ca..48dd1f3 100644
--- a/ooni/settings.py
+++ b/ooni/settings.py
@@ -156,6 +156,9 @@ if hasattr(sys, 'real_prefix'):
 
 # These are the the embedded settings
 _SETTINGS_INI = os.path.join(OONIPROBE_ROOT, 'settings.ini')
+# This can be overridden by an environment variable for end to end testing
+if 'OONIPROBE_SETTINGS' in os.environ:
+    _SETTINGS_INI = os.environ['OONIPROBE_SETTINGS']
 
 USR_SHARE_PATH = '/usr/share/ooni'
 VAR_LIB_PATH = '/var/lib/ooni'



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