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

[master] Allow all primitive grain types for autosign_grains #65232

Merged
merged 2 commits into from Oct 9, 2023

Conversation

agraul
Copy link
Contributor

@agraul agraul commented Sep 19, 2023

What does this PR do?

Allow non-str grain types for autosign grains. Currently the code is very naive and only compares grain == line, where grain can be any type a grain can be and line is a string. The change casts grain to a str, which makes it easy to use with e.g. numeric grains. More complex autosign_grains, such as nested dicts, are not really covered (str() is not stable across Python versions afaik).

What issues does this PR fix or reference?

Fixes: #61436
Fixes: #63708

Previous Behavior

Autosign_grain with a non-str (e.g. numeric/boolean) grain does not work (never matches the contents of a file in /etc/autosign_grains/).

New Behavior

Autosign_grain with a non-str (e.g. numeric/boolean) grain works.

Merge requirements satisfied?

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

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

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

@agraul agraul requested a review from a team as a code owner September 19, 2023 14:44
@agraul agraul requested review from Ch3LL and removed request for a team September 19, 2023 14:44
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Allow all primitive grain types for autosign_grains [master] Allow all primitive grain types for autosign_grains Sep 19, 2023
@agraul agraul temporarily deployed to ci September 19, 2023 15:01 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 15:01 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 15:02 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 15:02 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 15:19 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 15:21 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:17 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:17 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:18 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:18 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:18 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:18 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 19, 2023 16:30 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 14:45 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 14:45 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:09 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:09 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:09 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:09 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:25 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 15:28 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@agraul agraul temporarily deployed to ci September 27, 2023 18:00 — with GitHub Actions Inactive
@Ch3LL Ch3LL merged commit 74f02e8 into saltstack:master Oct 9, 2023
369 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants