-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Return correct result from module.run state #58752
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
Conversation
Ch3LL
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also add a changelog entry as documented here: https://docs.saltstack.com/en/master/topics/development/changelog.html
ed38d17 to
810e0d7
Compare
|
@amendlik looks like there are some merge conflicts that need to be cleaned up. |
70928c8 to
e0d13d5
Compare
module.run contained a bug where it would return True when run with test=true. According to the documentation at http://docs.saltstack.com/ref/states/writing.html#return-data the state should return None in test mode if a change would be made without test mode. Since module.run is not idempotent, the appropriate return should always be None, as long as no errors were encountered.
e0d13d5 to
12f2ae8
Compare
|
@Ch3LL Ok, I rewrote my changes so they will merge with the updated files. What else do I need to do to get this merged? |
|
@Ch3LL I would like to get this merged. What steps remain? |
2 similar comments
|
@Ch3LL I would like to get this merged. What steps remain? |
|
@Ch3LL I would like to get this merged. What steps remain? |
|
re-running the failed windows test to see if it is flakey or not, will check back later today on results |
2265644 to
5193dd1
Compare
What does this PR do?
Correct two bugs in the
module.runstate where the wrong result is returned.module.runshould returnNone, indicating that changes would be made when not run in test modeFalse, indicating an invocation error.What issues does this PR fix or reference?
None
Previous Behavior
module.runreturnedTrue, which indicates that no change would be made in in live mode. This is wrong becausemodules.runalways executes the configured functionsmodule.runreturnedTrue. This should returnFalseto indicate an error.New Behavior
module.runreturnsNone, which indicates that changes will be made in in live mode.module.runreturnFalse, which indicate an error.Merge requirements satisfied?
Commits signed with GPG?
Yes