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:
Mike Place 2016-02-16 10:17:58 -07:00
commit 70637d0beb

View File

@ -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: