Merge pull request #42210 from terminalmage/issue40928-2017.7

Only pass a saltenv in orchestration if one was explicitly passed (2017.7)
This commit is contained in:
Mike Place 2017-07-17 13:22:38 -05:00 committed by GitHub
commit e7b79e0fd2

View file

@ -245,14 +245,12 @@ def state(name,
if pillar:
cmd_kw['kwarg']['pillar'] = pillar
# If pillarenv is directly defined, use it
if pillarenv:
if pillarenv is not None:
cmd_kw['kwarg']['pillarenv'] = pillarenv
# Use pillarenv if it's passed from __opts__ (via state.orchestrate for example)
elif __opts__.get('pillarenv'):
cmd_kw['kwarg']['pillarenv'] = __opts__['pillarenv']
cmd_kw['kwarg']['saltenv'] = saltenv if saltenv is not None else __env__
if saltenv is not None:
cmd_kw['kwarg']['saltenv'] = saltenv
cmd_kw['kwarg']['queue'] = queue
if isinstance(concurrent, bool):