Skip to content

Load system grains when custom grains are set - #58964

Merged
dwoz merged 3 commits into
masterfrom
hotfix/grains_load
Nov 18, 2020
Merged

Load system grains when custom grains are set#58964
dwoz merged 3 commits into
masterfrom
hotfix/grains_load

Conversation

@Ch3LL

@Ch3LL Ch3LL commented Nov 17, 2020

Copy link
Copy Markdown
Contributor

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
Comment thread salt/minion.py Outdated
@dwoz
dwoz force-pushed the hotfix/grains_load branch from 1ef9c4d to 7baf21a Compare November 18, 2020 00:16
@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.

6 participants