mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 04:34:24 -07:00
Check for substates in is_failed before checking main state failure
Fixes #17882
This commit is contained in:
parent
72e6ffad47
commit
d09f57fb3a
1 changed files with 5 additions and 5 deletions
|
@ -80,7 +80,7 @@ class HostState:
|
||||||
ret.append(states[i])
|
ret.append(states[i])
|
||||||
return "|".join(ret)
|
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_block,
|
||||||
self.cur_regular_task,
|
self.cur_regular_task,
|
||||||
self.cur_rescue_task,
|
self.cur_rescue_task,
|
||||||
|
@ -499,6 +499,10 @@ class PlayIterator:
|
||||||
def _check_failed_state(self, state):
|
def _check_failed_state(self, state):
|
||||||
if state is None:
|
if state is None:
|
||||||
return False
|
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:
|
elif state.fail_state != self.FAILED_NONE:
|
||||||
if state.run_state == self.ITERATING_RESCUE and state.fail_state&self.FAILED_RESCUE == 0:
|
if state.run_state == self.ITERATING_RESCUE and state.fail_state&self.FAILED_RESCUE == 0:
|
||||||
return False
|
return False
|
||||||
|
@ -512,10 +516,6 @@ class PlayIterator:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
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
|
return False
|
||||||
|
|
||||||
def is_failed(self, host):
|
def is_failed(self, host):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue