Be sure to use the active state when checking for any_errors_fatal

The current code was not properly checking for the active state when
checking any_errors_fatal, so if the error occurred in a sub-block
or included file it is not properly detected.

Fixes #55515
This commit is contained in:
James Cammarata 2019-04-25 14:23:06 -05:00 committed by Toshio Kuratomi
parent 196018952b
commit f5de633197
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Be sure to use the active state when checking for any_errors_fatal

View file

@ -409,6 +409,9 @@ class StrategyModule(StrategyBase):
dont_fail_states = frozenset([iterator.ITERATING_RESCUE, iterator.ITERATING_ALWAYS])
for host in hosts_left:
(s, _) = iterator.get_next_task_for_host(host, peek=True)
# the state may actually be in a child state, use the get_active_state()
# method in the iterator to figure out the true active state
s = iterator.get_active_state(s)
if s.run_state not in dont_fail_states or \
s.run_state == iterator.ITERATING_RESCUE and s.fail_state & iterator.FAILED_RESCUE != 0:
self._tqm._failed_hosts[host.name] = True