Skip to content

Don't overwrite ID in opts - #59603

Merged
Ch3LL merged 6 commits into
saltstack:masterfrom
garethgreenaway:59351_dont_change_opts_in_match_module
Mar 4, 2021
Merged

Ch3LL merged 6 commits into
saltstack:masterfrom
garethgreenaway:59351_dont_change_opts_in_match_module

Conversation

@garethgreenaway

@garethgreenaway garethgreenaway commented Feb 24, 2021 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Changing the match module and various matchers to not change ID in opts, which leads to the wrong minion ID being used when running salt proxy minions with multiprocessing disabled. Moving test to pytest.

What issues does this PR fix or reference?

Fixes: #59351

Previous Behavior

When minion_id was passed as an argument to the various match functions, the minion id in opts was overwritten.

New Behavior

Now the various is simply passed along to the matcher functions as an optional argument.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

…ts, which leads to the wrong minion ID being used when running salt proxy minions with multiprocessing disabled. Moving test to pytest.
@garethgreenaway
garethgreenaway requested a review from a team as a code owner February 24, 2021 17:28
@garethgreenaway
garethgreenaway requested review from xeacott and removed request for a team February 24, 2021 17:28
@garethgreenaway garethgreenaway added the Aluminium Release Post Mg and Pre Si label Feb 24, 2021
Comment thread salt/matchers/list_match.py Resolved
Comment thread salt/modules/match.py Resolved
Comment thread salt/modules/match.py Resolved
Comment thread salt/modules/match.py Resolved
Comment thread salt/modules/match.py Resolved
…n_id in the engine_kwargs when using compound_match. Ensure minion_id is a valid argument for matchers which are called from compound_match.
@garethgreenaway
garethgreenaway force-pushed the 59351_dont_change_opts_in_match_module branch from 2f06dbc to 4b5ec8f Compare February 25, 2021 17:38

@Ch3LL Ch3LL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple questions to help my understanding of some of the changes.

"""
if not opts:
opts = __opts__
minion_id = opts.get("minion_id", opts["id"])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is expecting minion_id to be in opts? If we remove this are we removing functionality from somewhere else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was something that was previously in place to support metaproxy proxies but I found a few references related to pillar so I updated the code.

@Ch3LL
Ch3LL requested a review from s0undt3ch March 2, 2021 13:55
…use cases where minion_id is being passed in opts. Fallback to id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Aluminium Release Post Mg and Pre Si

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy minion stops responding after calling match.compound with minion_id

5 participants