mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39286 from terminalmage/fix-pillarenv-precedence
Allow minion/CLI saltenv/pillarenv to override master when compiling pillar
This commit is contained in:
commit
77e50ed8b7
1 changed files with 7 additions and 4 deletions
|
@ -372,11 +372,14 @@ class Pillar(object):
|
|||
opts['grains'] = {}
|
||||
else:
|
||||
opts['grains'] = grains
|
||||
if not opts.get('environment'):
|
||||
opts['environment'] = saltenv
|
||||
# Allow minion/CLI saltenv/pillarenv to take precedence over master
|
||||
opts['environment'] = saltenv \
|
||||
if saltenv is not None \
|
||||
else opts.get('environment')
|
||||
opts['pillarenv'] = pillarenv \
|
||||
if pillarenv is not None \
|
||||
else opts.get('pillarenv')
|
||||
opts['id'] = self.minion_id
|
||||
if not opts.get('pillarenv'):
|
||||
opts['pillarenv'] = pillarenv
|
||||
if opts['state_top'].startswith('salt://'):
|
||||
opts['state_top'] = opts['state_top']
|
||||
elif opts['state_top'].startswith('/'):
|
||||
|
|
Loading…
Add table
Reference in a new issue