[3006.x] module.run: fix result detection from returned dict#67115
Merged
dwoz merged 5 commits intosaltstack:3006.xfrom Apr 23, 2025
Merged
[3006.x] module.run: fix result detection from returned dict#67115dwoz merged 5 commits intosaltstack:3006.xfrom
dwoz merged 5 commits intosaltstack:3006.xfrom
Conversation
bdrx312
suggested changes
Jan 11, 2025
1c23b3d to
e4946c3
Compare
bdrx312
reviewed
Jan 14, 2025
e4946c3 to
b361e25
Compare
bdrx312
approved these changes
Jan 15, 2025
twangboy
previously approved these changes
Jan 29, 2025
Contributor
|
I have literally migrated the whole file over to pytest, with some modifications. I have keep the same author because it's still created by Nicole Thomas. |
twangboy
approved these changes
Mar 31, 2025
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?
Fixes #65842 Module.run state returns invalid result when method returns a dict
module.run should also check for a key
resultin the return of the executed module to determin if it was successful.But this only works for the legacy- and not the new-style.
This is because in the new-style, the
_get_resultfunction is always executed with a actually empty dict as thechangesparameter, where it searches for theresultkey.Also this
changesparameter is not necessary as even, in the case of the legacy-style, it is effectively just a copy of thefunc_retparameter.