[Calypso] [PATCH 2/3] Allow to override calypso's config dir

Guido Günther agx at sigxcpu.org
Sun Mar 30 06:41:43 PDT 2014


This can be useful when running automatic tests via e.g. autopkgtest
where we want to have all files in a temporary directory.
---
 calypso/config.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/calypso/config.py b/calypso/config.py
index bf28cb9..8d7b5d2 100644
--- a/calypso/config.py
+++ b/calypso/config.py
@@ -70,6 +70,9 @@ for section, values in INITIAL_CONFIG.items():
 
 _CONFIG_PARSER.read("/etc/calypso/config")
 _CONFIG_PARSER.read(os.path.expanduser("~/.config/calypso/config"))
+cfg = os.getenv("CALYPSO_CONFIG")
+if cfg:
+    _CONFIG_PARSER.read(cfg)
 
 # Wrap config module into ConfigParser instance
 sys.modules[__name__] = _CONFIG_PARSER
-- 
1.9.0



More information about the Calypso mailing list