Repository navigation
Fix behavior for "onlyif/unless" conditional when multiple declarations - #59345
Merged
Ch3LL merged 9 commits intoFeb 11, 2021
Merged
Conversation
Ch3LL
reviewed
Jan 28, 2021
Ch3LL
suggested changes
Jan 28, 2021
Ch3LL
left a comment
Contributor
There was a problem hiding this comment.
Just need to add a changelog and have one question in the PR. Thanks :)
Contributor
Author
|
Changelog pushed. Thanks for the review @Ch3LL :) |
Ch3LL
approved these changes
Feb 9, 2021
garethgreenaway
approved these changes
Feb 10, 2021
1 of 3 tasks
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?
This PR fixes a problem with the logic for
onlyifandunlessstate conditionals that makes states with multiple "onlyif" or "unless" conditionals to only take care of the latest condition to compute the results.This causes a wrong behavior when applying states like the following:
NOTE: This bug seems to be present since Salt 3000.
What issues does this PR fix or reference?
Fixes: #58085
Previous Behavior
Without this PR, the output from the above state execution using
test=Trueis not behaving properly:Notice the conditions for
package_should_not_be_installed_2didn't work as expected an the package was set to be installed even if the first of itsonlyifconditions returnedFalseNew Behavior
After this PR, the output is the expected one:
Merge requirements satisfied?
Commits signed with GPG?
Yes