Fix any_errors_fatal incorrect implementation in 2.0

Also adds that flag to blocks.

Fixes #13744
This commit is contained in:
James Cammarata 2016-01-15 13:14:27 -05:00
commit 1825b4a9c7
5 changed files with 37 additions and 11 deletions

View file

@ -151,9 +151,7 @@ class PlaybookExecutor:
# conditions are met, we break out, otherwise we only break out if the entire
# batch failed
failed_hosts_count = len(self._tqm._failed_hosts) + len(self._tqm._unreachable_hosts)
if new_play.any_errors_fatal and failed_hosts_count > 0:
break
elif new_play.max_fail_percentage is not None and \
if new_play.max_fail_percentage is not None and \
int((new_play.max_fail_percentage)/100.0 * len(batch)) > int((len(batch) - failed_hosts_count) / len(batch) * 100.0):
break
elif len(batch) == failed_hosts_count: