Skip to content

Commit

Permalink
Fix #22063: pillar wildcard support include
Browse files Browse the repository at this point in the history
  • Loading branch information
wych42 committed Jan 4, 2018
1 parent 8da4964 commit fbab73a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions salt/pillar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,24 @@ def render_pstate(self, sls, saltenv, mods, defaults=None):
log.error(msg)
errors.append(msg)
else:
matched_pstates = []
for sub_sls in state.pop('include'):
if isinstance(sub_sls, dict):
sub_sls, v = next(six.iteritems(sub_sls))
defaults = v.get('defaults', {})
key = v.get('key', None)
else:
key = None

try:
matched_pstates = fnmatch.filter(self.avail[saltenv], sub_sls)
except KeyError:
errors.extend(
['No matching pillar environment for environment '
'\'{0}\' found'.format(saltenv)]
)

for sub_sls in matched_pstates:
if sub_sls not in mods:
nstate, mods, err = self.render_pstate(
sub_sls,
Expand Down

0 comments on commit fbab73a

Please sign in to comment.