-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Loop until no eval master #55639
Merged
dwoz
merged 21 commits into
saltstack:master
from
ogd-software:loop_until-no-eval-master
Jan 4, 2020
Merged
Loop until no eval master #55639
dwoz
merged 21 commits into
saltstack:master
from
ogd-software:loop_until-no-eval-master
Jan 4, 2020
Conversation
This file contains 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
…t using eval(). Added unittests.
…init_wait parameters.
…alth, used in the examples. Add explanation of usage of data.subdict_match, with nice (unresolved) link.
ghost
requested a review
from Akm0d
December 13, 2019 16:25
and add pylint-disable statements to avoid unneccesary noise
since it kept suggesting to add an import that is not needed nor used. If you add the import and then lint using .pylintrc, it then complains about the unused import.
Codecov Report
@@ Coverage Diff @@
## master #55639 +/- ##
=========================================
Coverage ? 38.36%
=========================================
Files ? 1464
Lines ? 260186
Branches ? 54980
=========================================
Hits ? 99789
Misses ? 149039
Partials ? 11358
|
waynew
approved these changes
Dec 27, 2019
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.
Looks great! Just merged the most recent changes in, but this should be ready to go once tests pass.
Closed
dwoz
requested changes
Jan 1, 2020
dwoz
approved these changes
Jan 4, 2020
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.
This is #53958, rebased on master.
What does this PR do?
It provides an alternative to
loop.until
that does not useeval
.Added example for using this in the faq. Made some pylint-inspired changes.
I'm not entirely sure that the name of the new state
until_no_eval
is good enough (even though it is accurate), since it feels wrong to name a function with something that it does not have. I'm open to suggestions on this.What issues does this PR fix or reference?
None
Previous Behavior
The generic state that allows you to (blockingly) execute a salt function until it produces a desired output hinged on using
eval
with user-input. Since this is potentially very dangerous, an alternative has been supplied.New Behavior
A state exists (
loop.until_no_eval
) that will block execution until a specific salt execution module function returns an expected result. This produced result is passed together with the expected result to a function (either a method of python'soperator
, a function from__salt__
or__utils__
) to produce a boolean indicating success (or failure).Additionally, a parameter
init_wait
is available to configure a waiting period before the 1st call of the salt function is made.Tests written?
Yes
Commits signed with GPG?
Yes