Repository navigation
Document returning False in test=True mode - #42576
Merged
rallytime merged 1 commit intoAug 15, 2017
Merged
Conversation
Currently, in test mode states always return None even on failure. This masks failed states in highstate output, which instead just look like they are going to make changes. In some cases states can determine if they will fail even on a dry run, e.g., if an API call to a service to determine the state of a resource fails due to invalid credentials or a missing parameter. In these cases, allow returning a result of False even in dry runs to enable catching more errors at testing time.
|
@aneeshusa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jfindlay, @thatch45 and @whiteinge to be potential reviewers. |
whiteinge
self-requested a review
July 27, 2017 01:06
whiteinge
approved these changes
Aug 15, 2017
rallytime
approved these changes
Aug 15, 2017
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.
Currently, in test mode states always return None even on failure.
This masks failed states in highstate output,
which instead just look like they are going to make changes.
In some cases states can determine if they will fail even on a dry run,
e.g., if an API call to a service to determine the state of a
resource fails due to invalid credentials or a missing parameter.
In these cases, allow returning a result of False even in dry runs
to enable catching more errors at testing time.
What does this PR do?
Document an extension to State module best practices
What issues does this PR fix or reference?
#42553
Previous Behavior
States always return
Noneintest=TruemodeNew Behavior
States can return
Falseon failure intest=TruemodeTests written?
No
Please review Salt's Contributing Guide for best practices.