Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload matcher loader when ext_pillar_first set #52851

Merged
merged 2 commits into from May 7, 2019

Conversation

@Ch3LL
Copy link
Contributor

commented May 6, 2019

What does this PR do?

When ext_pillar_first is set and the pillar is in external pillar that is needed to compile the top file it fails. Because we load the matchers in __init__ and later on we add the ext pillar data to self.opts we need to re-load the matcher loader so the correct pillar data ends up in __opts__['pillar']

What issues does this PR fix or reference?

#52597

Previous Behavior

Receive this error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/master.py", line 1838, in run_func
    ret = getattr(self, func)(load)
  File "/usr/lib/python2.7/site-packages/salt/master.py", line 1543, in _pillar
    data = pillar.compile_pillar()
  File "/usr/lib/python2.7/site-packages/salt/pillar/__init__.py", line 1005, in compile_pillar
    matches = self.top_matches(top)
  File "/usr/lib/python2.7/site-packages/salt/pillar/__init__.py", line 675, in top_matches
    self.opts.get('nodegroups', {}),
  File "/usr/lib/python2.7/site-packages/salt/matchers/confirm_top.py", line 36, in confirm_top
    return m(match)
  File "/usr/lib/python2.7/site-packages/salt/matchers/pillar_match.py", line 24, in match
    __opts__['pillar'], tgt, delimiter=delimiter
KeyError: u'pillar'

New Behavior

pillar data and top file compiled correctly.

Tests written?

Yes

Commits signed with GPG?

Yes

Ch3LL added 2 commits May 6, 2019
@Ch3LL Ch3LL requested a review from saltstack/team-core as a code owner May 6, 2019
@Ch3LL Ch3LL merged commit 2e4f296 into saltstack:2019.2.1 May 7, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.