summaryrefslogtreecommitdiff
path: root/lib/ansible/executor
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-10-04 01:21:07 -0500
committerJames Cammarata <jimi@sngx.net>2016-10-04 01:21:07 -0500
commitd09f57fb3a65b35e22378bf5e40db0c197b71591 (patch)
tree332ab8e7ab54cb11918b2972dec4271cfafed32f /lib/ansible/executor
parent72e6ffad471f0c3aadfd9563e43d7a7c95ff74aa (diff)
downloadansible-d09f57fb3a65b35e22378bf5e40db0c197b71591.tar.gz
Check for substates in is_failed before checking main state failureissue_17882
Fixes #17882
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r--lib/ansible/executor/play_iterator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py
index 73dc111a52..ac10874357 100644
--- a/lib/ansible/executor/play_iterator.py
+++ b/lib/ansible/executor/play_iterator.py
@@ -80,7 +80,7 @@ class HostState:
ret.append(states[i])
return "|".join(ret)
- return "HOST STATE: block=%d, task=%d, rescue=%d, always=%d, role=%s, run_state=%s, fail_state=%s, pending_setup=%s, tasks child state? %s, rescue child state? %s, always child state? %s, did start at task? %s" % (
+ return "HOST STATE: block=%d, task=%d, rescue=%d, always=%d, role=%s, run_state=%s, fail_state=%s, pending_setup=%s, tasks child state? (%s), rescue child state? (%s), always child state? (%s), did start at task? %s" % (
self.cur_block,
self.cur_regular_task,
self.cur_rescue_task,
@@ -499,6 +499,10 @@ class PlayIterator:
def _check_failed_state(self, state):
if state is None:
return False
+ elif state.run_state == self.ITERATING_RESCUE and self._check_failed_state(state.rescue_child_state):
+ return True
+ elif state.run_state == self.ITERATING_ALWAYS and self._check_failed_state(state.always_child_state):
+ return True
elif state.fail_state != self.FAILED_NONE:
if state.run_state == self.ITERATING_RESCUE and state.fail_state&self.FAILED_RESCUE == 0:
return False
@@ -512,10 +516,6 @@ class PlayIterator:
return False
else:
return True
- elif state.run_state == self.ITERATING_RESCUE and self._check_failed_state(state.rescue_child_state):
- return True
- elif state.run_state == self.ITERATING_ALWAYS and self._check_failed_state(state.always_child_state):
- return True
return False
def is_failed(self, host):