-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix behavior for "onlyif/unless" conditional when multiple declarations #59345
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
Merged
Ch3LL
merged 9 commits into
saltstack:master
from
meaksh:master-fix-onlyif-and-unless-behaviors
Feb 11, 2021
Merged
Fix behavior for "onlyif/unless" conditional when multiple declarations #59345
Ch3LL
merged 9 commits into
saltstack:master
from
meaksh:master-fix-onlyif-and-unless-behaviors
Feb 11, 2021
Conversation
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
Ch3LL
reviewed
Jan 28, 2021
Ch3LL
suggested changes
Jan 28, 2021
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.
Just need to add a changelog and have one question in the PR. Thanks :)
Changelog pushed. Thanks for the review @Ch3LL :) |
Ch3LL
approved these changes
Feb 9, 2021
garethgreenaway
approved these changes
Feb 10, 2021
3 tasks
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
onlyif
andunless
state 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=True
is not behaving properly:Notice the conditions for
package_should_not_be_installed_2
didn't work as expected an the package was set to be installed even if the first of itsonlyif
conditions returnedFalse
New Behavior
After this PR, the output is the expected one:
Merge requirements satisfied?
Commits signed with GPG?
Yes