mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Docs + fix variable precedence of environment variables (ok, ok, I give in!)
This commit is contained in:
@@ -21,6 +21,8 @@ import ConfigParser
|
||||
import traceback
|
||||
|
||||
def get_config(p, section, key, env_var, default):
|
||||
if env_var is not None:
|
||||
return os.environ.get(env_var, default)
|
||||
if p is not None:
|
||||
try:
|
||||
return p.get(section, key)
|
||||
@@ -29,8 +31,6 @@ def get_config(p, section, key, env_var, default):
|
||||
return os.environ.get(env_var, default)
|
||||
return default
|
||||
else:
|
||||
if env_var is not None:
|
||||
return os.environ.get(env_var, default)
|
||||
return default
|
||||
|
||||
def load_config_file():
|
||||
|
||||
Reference in New Issue
Block a user