1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixing bug in failed_when results introduced by c3c398c

This commit is contained in:
Uli Martens 2015-06-26 16:54:13 -04:00 committed by James Cammarata
parent 6b1ec141cb
commit 25fc0c7e1b

View file

@ -43,7 +43,8 @@ class TaskResult:
return self._check_key('skipped')
def is_failed(self):
if 'results' in self._result and True in [True for x in self._result['results'] if 'failed_when_result' in x]:
if 'failed_when_result' in self._result or \
'results' in self._result and True in [True for x in self._result['results'] if 'failed_when_result' in x]:
return self._check_key('failed_when_result')
else:
return self._check_key('failed') or self._result.get('rc', 0) != 0