1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix bug with any_errors_fatal where task was not available

This commit is contained in:
James Cammarata 2016-01-21 16:41:05 -05:00
parent d02dee37a1
commit 4651155942

View file

@ -177,6 +177,9 @@ class StrategyModule(StrategyBase):
skip_rest = False
choose_step = True
# flag set if task is set to any_errors_fatal
any_errors_fatal = False
results = []
for (host, task) in host_tasks:
if not task:
@ -188,6 +191,9 @@ class StrategyModule(StrategyBase):
run_once = False
work_to_do = True
if task.any_errors_fatal:
any_errors_fatal = True
# test to see if the task across all hosts points to an action plugin which
# sets BYPASS_HOST_LOOP to true, or if it has run_once enabled. If so, we
# will only send this task to the first host in the list.
@ -348,7 +354,7 @@ class StrategyModule(StrategyBase):
failed_hosts.append(res._host.name)
# if any_errors_fatal and we had an error, mark all hosts as failed
if task and task.any_errors_fatal and len(failed_hosts) > 0:
if any_errors_fatal and len(failed_hosts) > 0:
for host in hosts_left:
# don't double-mark hosts, or the iterator will potentially
# fail them out of the rescue/always states