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

Load system grains when custom grains are set #58964

Merged
merged 3 commits into from Nov 18, 2020
Merged

Load system grains when custom grains are set #58964

merged 3 commits into from Nov 18, 2020

Conversation

Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented Nov 17, 2020

What does this PR do?

After this PR was merged in #58903 if you have custom grains set in your config file the grains will not be loaded when we initialize the salt.minion.Minion object. This results in the grains being loaded at a much later time. This will fix this test failure: tests.integration.modules.test_state.StateModuleTest.test_get_file_from_env_in_top_match This test is failing only on pytest because during this test we startup the sub_minion. When this test tries to render the general.sls pillar file it fails because os is not in the grains dict yet. If I delay the startup of the sub_minion the test passes, but we should ensure we are loading the grains sooner when custom grains are set in the config file.

I am still working on writing tests for this right now.

@Ch3LL Ch3LL requested a review from a team as a code owner November 17, 2020 15:28
@Ch3LL Ch3LL requested review from Akm0d and removed request for a team November 17, 2020 15:28
salt/minion.py Outdated Show resolved Hide resolved
@dwoz dwoz merged commit 439d4b6 into master Nov 18, 2020
@s0undt3ch s0undt3ch deleted the hotfix/grains_load branch November 30, 2020 10:46
@sagetherage sagetherage added the Aluminium Release Post Mg and Pre Si label Mar 5, 2021
bdrung pushed a commit to bdrung/salt that referenced this pull request Oct 26, 2021
Squash the commits from the merge request:

* a139f6f
* 91145a1
* 439d4b6

Origin: upstream, saltstack#58964
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.

None yet

6 participants