Skip to content

Fix refresh of osrelease and related grains on Python 3.10+ #67933

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

meaksh
Copy link
Contributor

@meaksh meaksh commented Apr 1, 2025

What does this PR do?

This PR fixes an issue introduced by dab8ea5 , as the platform library contains an internal os release cache.

This internal cache causes that the osrelease and other related grains are not getting refreshed when running saltutil.refresh_grains.

This PR fixes this issue, by invalidating the internal cache, if existing, at the time of calculating the os related grains.

What issues does this PR fix or reference?

Fixes #67932

Previous Behavior

On Python 3.10+ grains are not refreshed while they get refreshed on Python < 3.10

New Behavior

Consistent behavior across Python versions. Grains get refreshed.

Merge requirements satisfied?

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

Commits signed with GPG?

Yes

@meaksh meaksh requested a review from a team as a code owner April 1, 2025 15:34
Copy link
Contributor

@twangboy twangboy left a comment

Choose a reason for hiding this comment

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

Could you write a test for this please?

@twangboy twangboy added this to the Sulfur v3006.11 milestone Apr 1, 2025
@meaksh meaksh force-pushed the 3006.x-fix-osrelease-grains-refresh branch from a58549b to c4deb48 Compare April 2, 2025 11:04
@meaksh
Copy link
Contributor Author

meaksh commented Apr 2, 2025

Could you write a test for this please?

Just added a unit test for this

@meaksh meaksh requested a review from twangboy April 2, 2025 12:26
@twangboy twangboy force-pushed the 3006.x-fix-osrelease-grains-refresh branch from 4e1ec76 to 4124682 Compare April 23, 2025 13:40
@dwoz dwoz merged commit 07626e6 into saltstack:3006.x Apr 25, 2025
692 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants