mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Env var vs config priority fixing
This commit is contained in:
parent
21b1e6c5a4
commit
fd6a26239c
1 changed files with 3 additions and 1 deletions
|
@ -22,7 +22,9 @@ import traceback
|
||||||
|
|
||||||
def get_config(p, section, key, env_var, default):
|
def get_config(p, section, key, env_var, default):
|
||||||
if env_var is not None:
|
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:
|
if p is not None:
|
||||||
try:
|
try:
|
||||||
return p.get(section, key)
|
return p.get(section, key)
|
||||||
|
|
Loading…
Reference in a new issue