Merge pull request #46493 from terminalmage/issue46207

salt-call: don't re-use initial pillar if CLI overrides passed
This commit is contained in:
Nicole Thomas 2018-03-12 16:41:51 -04:00 committed by GitHub
commit 0e90c8ca6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -703,8 +703,12 @@ class State(object):
except AttributeError:
pillar_enc = str(pillar_enc).lower()
self._pillar_enc = pillar_enc
if initial_pillar:
if initial_pillar and not self._pillar_override:
self.opts['pillar'] = initial_pillar
else:
# Compile pillar data
self.opts['pillar'] = self._gather_pillar()
# Reapply overrides on top of compiled pillar
if self._pillar_override:
self.opts['pillar'] = salt.utils.dictupdate.merge(
self.opts['pillar'],
@ -712,8 +716,6 @@ class State(object):
self.opts.get('pillar_source_merging_strategy', 'smart'),
self.opts.get('renderer', 'yaml'),
self.opts.get('pillar_merge_lists', False))
else:
self.opts['pillar'] = self._gather_pillar()
self.state_con = context or {}
self.load_modules()
self.active = set()