mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix pillar includes from merging over the current sls defines
ihttps://github.com/saltstack/salt/issues/39860
This commit is contained in:
parent
ff9880c498
commit
1152202fdc
1 changed files with 14 additions and 5 deletions
|
@ -664,6 +664,8 @@ class Pillar(object):
|
|||
log.error(msg)
|
||||
errors.append(msg)
|
||||
else:
|
||||
# render included state(s)
|
||||
include_states = []
|
||||
for sub_sls in state.pop('include'):
|
||||
if isinstance(sub_sls, dict):
|
||||
sub_sls, v = next(six.iteritems(sub_sls))
|
||||
|
@ -685,16 +687,23 @@ class Pillar(object):
|
|||
nstate = {
|
||||
key_fragment: nstate
|
||||
}
|
||||
|
||||
include_states.append(nstate)
|
||||
if err:
|
||||
errors += err
|
||||
if include_states:
|
||||
# merge included state(s) with the current state merged last
|
||||
include_states.append(state)
|
||||
state = None
|
||||
for s in include_states:
|
||||
if state is None:
|
||||
state = s
|
||||
else:
|
||||
state = merge(
|
||||
state,
|
||||
nstate,
|
||||
s,
|
||||
self.merge_strategy,
|
||||
self.opts.get('renderer', 'yaml'),
|
||||
self.opts.get('pillar_merge_lists', False))
|
||||
|
||||
if err:
|
||||
errors += err
|
||||
return state, mods, errors
|
||||
|
||||
def render_pillar(self, matches, errors=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue