Be sure to use the active state when checking for any_errors_fatal (#55779)

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-26 10:31:30 -05:00 committed by GitHub
parent 943f7334c5
commit 7a46fe6693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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