Merged
Conversation
…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.
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
Contributor
waynew
left a comment
There was a problem hiding this comment.
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
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.
This is #53958, rebased on master.
What does this PR do?
It provides an alternative to
loop.untilthat 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_evalis 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
evalwith 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_waitis available to configure a waiting period before the 1st call of the salt function is made.Tests written?
Yes
Commits signed with GPG?
Yes