From fd6a26239cc2eeba8ada3f80e49e3cdf1d999f0c Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 17 Oct 2012 22:34:59 -0400 Subject: [PATCH] Env var vs config priority fixing --- lib/ansible/constants.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 22aa3a807b3..b04e20cb88e 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -22,7 +22,9 @@ import traceback def get_config(p, section, key, env_var, default): if env_var is not None: - return os.environ.get(env_var, default) + value = os.environ.get(env_var, None) + if value is not None: + return value if p is not None: try: return p.get(section, key)