use dictupdate.merge instead of dict.update to merge CLI pillar overrides

Fixes #18429.
This commit is contained in:
Erik Johnson 2016-03-31 17:31:32 -05:00
parent 1d9321d043
commit db31732137
2 changed files with 15 additions and 3 deletions

View File

@ -723,7 +723,13 @@ class Pillar(object):
return pillar, errors
ext = None
# Bring in CLI pillar data
pillar.update(self.pillar_override)
if self.pillar_override and isinstance(self.pillar_override, dict):
pillar = merge(pillar,
self.pillar_override,
self.merge_strategy,
self.opts.get('renderer', 'yaml'),
self.opts.get('pillar_merge_lists', False))
for run in self.opts['ext_pillar']:
if not isinstance(run, dict):
errors.append('The "ext_pillar" option is malformed')
@ -802,6 +808,14 @@ class Pillar(object):
for error in errors:
log.critical('Pillar render error: {0}'.format(error))
pillar['_errors'] = errors
if self.pillar_override and isinstance(self.pillar_override, dict):
pillar = merge(pillar,
self.pillar_override,
self.merge_strategy,
self.opts.get('renderer', 'yaml'),
self.opts.get('pillar_merge_lists', False))
return pillar

View File

@ -649,8 +649,6 @@ class State(object):
pillarenv=self.opts.get('pillarenv')
)
ret = pillar.compile_pillar()
if self._pillar_override and isinstance(self._pillar_override, dict):
ret.update(self._pillar_override)
return ret
def _mod_init(self, low):