mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-13 03:44:02 -07:00
Docs + fix variable precedence of environment variables (ok, ok, I give in!)
This commit is contained in:
parent
95db898cde
commit
63100c9bc0
2 changed files with 31 additions and 8 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue