mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #31358 from Ashald/bugfix/state-sls-environment
Make sure state.sls preserves saltenv/pillarenv
This commit is contained in:
commit
abb4539dc8
@ -712,15 +712,12 @@ def sls(mods,
|
||||
saltenv = __opts__['environment']
|
||||
else:
|
||||
saltenv = 'base'
|
||||
else:
|
||||
__opts__['environment'] = saltenv
|
||||
|
||||
if not pillarenv:
|
||||
if __opts__.get('pillarenv', None):
|
||||
pillarenv = __opts__['pillarenv']
|
||||
else:
|
||||
__opts__['pillarenv'] = pillarenv
|
||||
|
||||
# Modification to __opts__ lost after this if-else
|
||||
if queue:
|
||||
_wait(kwargs.get('__pub_jid'))
|
||||
else:
|
||||
@ -729,6 +726,10 @@ def sls(mods,
|
||||
__context__['retcode'] = 1
|
||||
return conflict
|
||||
|
||||
# Ensure desired environment
|
||||
__opts__['environment'] = saltenv
|
||||
__opts__['pillarenv'] = pillarenv
|
||||
|
||||
if isinstance(mods, list):
|
||||
disabled = _disabled(mods)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user