mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +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
|
continue
|
||||||
if r_state == 'onfail':
|
if r_state == 'onfail':
|
||||||
if run_dict[tag]['result'] is True:
|
if run_dict[tag]['result'] is True:
|
||||||
fun_stats.add('onfail')
|
fun_stats.add('onfail') # At least one state is OK
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
if run_dict[tag]['result'] is False:
|
if run_dict[tag]['result'] is False:
|
||||||
@ -1884,8 +1884,8 @@ class State(object):
|
|||||||
status = 'met'
|
status = 'met'
|
||||||
else:
|
else:
|
||||||
status = 'pre'
|
status = 'pre'
|
||||||
elif 'onfail' in fun_stats:
|
elif 'onfail' in fun_stats and 'met' not in fun_stats:
|
||||||
status = 'onfail'
|
status = 'onfail' # all onfail states are OK
|
||||||
elif 'onchanges' in fun_stats and 'onchangesmet' not in fun_stats:
|
elif 'onchanges' in fun_stats and 'onchangesmet' not in fun_stats:
|
||||||
status = 'onchanges'
|
status = 'onchanges'
|
||||||
elif 'change' in fun_stats:
|
elif 'change' in fun_stats:
|
||||||
|
Loading…
Reference in New Issue
Block a user