mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #31235 from DSRCompany/issues/22370_trigger_onfail_with_or_logic
Trigger onfail state if any target failed
This commit is contained in:
commit
70637d0beb
@ -1853,7 +1853,7 @@ class State(object):
|
||||
continue
|
||||
if r_state == 'onfail':
|
||||
if run_dict[tag]['result'] is True:
|
||||
fun_stats.add('onfail')
|
||||
fun_stats.add('onfail') # At least one state is OK
|
||||
continue
|
||||
else:
|
||||
if run_dict[tag]['result'] is False:
|
||||
@ -1884,8 +1884,8 @@ class State(object):
|
||||
status = 'met'
|
||||
else:
|
||||
status = 'pre'
|
||||
elif 'onfail' in fun_stats:
|
||||
status = 'onfail'
|
||||
elif 'onfail' in fun_stats and 'met' not in fun_stats:
|
||||
status = 'onfail' # all onfail states are OK
|
||||
elif 'onchanges' in fun_stats and 'onchangesmet' not in fun_stats:
|
||||
status = 'onchanges'
|
||||
elif 'change' in fun_stats:
|
||||
|
Loading…
Reference in New Issue
Block a user