[tor-commits] [ooni-probe/master] Add support for specifying a settings.ini file via environment variables
art at torproject.org
art at torproject.org
Fri Jan 13 12:39:57 UTC 2017
commit ee68602abac9c5f66ba81c4df95822a3ccd87bda
Author: Arturo Filastò <arturo at filasto.net>
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'
More information about the tor-commits
mailing list