Properly fail results with rc != 0

Fixes #11769
This commit is contained in:
James Cammarata 2015-07-28 10:14:48 -04:00
parent 787a0c4e04
commit 2d90cbf78b

View file

@ -327,9 +327,12 @@ class TaskExecutor:
result['failed_when_result'] = result['failed'] = failed_when_result
if failed_when_result:
break
elif 'failed' not in result and result.get('rc', 0) == 0:
# if the result is not failed, stop trying
break
elif 'failed' not in result:
if result.get('rc', 0) != 0:
result['failed'] = True
else:
# if the result is not failed, stop trying
break
if attempt < retries - 1:
time.sleep(delay)