-
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
Add an option for the onfail requisite to not report a failure #16291
Comments
Oh, so you can have "clean" output due to the fact that another state handled the failure condition of the first? Interesting. Naming this thing could be a challenge. :] |
Exactly. Perhaps something along the lines of the 'reload' option to the |
just ran into this. so confuse ;) |
@whiteinge @cachedout this feature would be really nice. Indeed naming is a difficult part of the job. @whiteinge I'm not sure what you mean about the reload in mod_watch. What about, for
or for
|
The service mod_watch function accepts arguments. E.g., restart_stuff:
service.restart:
- watch: another_state
- reload: True # graceful reload instead of a restart An onfail equivalent could be: recover_after_failure:
some.recovery-action:
- onfail: another_state
- catch_error: True # set result to True on the watched state because we recovered |
Me, too! I was about to write this up as a bug, rather than an enhancement request. Recovered failures are not failures. For example, attempting to stop a service which has never been installed. I wrote several scripts like:...
but, of course, that did not work as I had hoped.
|
ran again into this one? Is there any workaround available, if a state is expected to fail and can be recovered by another state? |
I vaguely recall this was addressed...in #39874 perhaps? Looks like it wasn't documented/announced, if so. I don't have an env handy to verify -- do you mind trying the following syntax?
|
May be i'm too stupid but i created this example:
But the output is still:
But i would expect that this state can't fail as it has recovered. |
Pinging @kiorky. Am I reading that PR correctly? |
Should this be re-labeled confirmed that the PR in the linked issue didn't work. I am seeing the same behaviour with or without the flag present. When present, set to true or false makes no difference either
This is the latest release version of salt
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
still valid |
Thank you for updating this issue. It is no longer marked as stale. |
@whiteinge you are right, it was on that purpose. |
@whiteinge Closing this due to age, the old version of Salt and Python 2. Understanding that you probably add this to track the issue back when on the core team in 2014. |
If an onfail requisite provides some mitigation for the failure we should have an option to not count the original failure as a fail.
The text was updated successfully, but these errors were encountered: