Load system grains when custom grains are set - #58964
Merged
Merged
Conversation
s0undt3ch
suggested changes
Nov 17, 2020
dwoz
force-pushed
the
hotfix/grains_load
branch
from
November 18, 2020 00:16
1ef9c4d to
7baf21a
Compare
s0undt3ch
approved these changes
Nov 18, 2020
krionbsd
approved these changes
Nov 18, 2020
garethgreenaway
approved these changes
Nov 18, 2020
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_matchThis test is failing only on pytest because during this test we startup thesub_minion. When this test tries to render thegeneral.slspillar file it fails becauseosis not in the grains dict yet. If I delay the startup of thesub_minionthe 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.