mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +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']
|
saltenv = __opts__['environment']
|
||||||
else:
|
else:
|
||||||
saltenv = 'base'
|
saltenv = 'base'
|
||||||
else:
|
|
||||||
__opts__['environment'] = saltenv
|
|
||||||
|
|
||||||
if not pillarenv:
|
if not pillarenv:
|
||||||
if __opts__.get('pillarenv', None):
|
if __opts__.get('pillarenv', None):
|
||||||
pillarenv = __opts__['pillarenv']
|
pillarenv = __opts__['pillarenv']
|
||||||
else:
|
|
||||||
__opts__['pillarenv'] = pillarenv
|
|
||||||
|
|
||||||
|
# Modification to __opts__ lost after this if-else
|
||||||
if queue:
|
if queue:
|
||||||
_wait(kwargs.get('__pub_jid'))
|
_wait(kwargs.get('__pub_jid'))
|
||||||
else:
|
else:
|
||||||
@ -729,6 +726,10 @@ def sls(mods,
|
|||||||
__context__['retcode'] = 1
|
__context__['retcode'] = 1
|
||||||
return conflict
|
return conflict
|
||||||
|
|
||||||
|
# Ensure desired environment
|
||||||
|
__opts__['environment'] = saltenv
|
||||||
|
__opts__['pillarenv'] = pillarenv
|
||||||
|
|
||||||
if isinstance(mods, list):
|
if isinstance(mods, list):
|
||||||
disabled = _disabled(mods)
|
disabled = _disabled(mods)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user