From da307c8bfdfdb4dbd073bef97a72cb78c23ff879 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 7 Jul 2015 16:09:11 -0400 Subject: [PATCH] Fix bug in logic introduced in 614c626 --- lib/ansible/plugins/strategies/linear.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/plugins/strategies/linear.py b/lib/ansible/plugins/strategies/linear.py index 3d14f2d49b..23c1eec049 100644 --- a/lib/ansible/plugins/strategies/linear.py +++ b/lib/ansible/plugins/strategies/linear.py @@ -203,16 +203,16 @@ class StrategyModule(StrategyBase): if run_once: break - if not work_to_do: + debug("done queuing things up, now waiting for results queue to drain") + results = self._wait_on_pending_results(iterator) + host_results.extend(results) + + if not work_to_do and len(iterator.get_failed_hosts()) > 0: debug("out of hosts to run on") self._tqm.send_callback('v2_playbook_on_no_hosts_remaining') result = False break - debug("done queuing things up, now waiting for results queue to drain") - results = self._wait_on_pending_results(iterator) - host_results.extend(results) - try: included_files = IncludedFile.process_include_results(host_results, self._tqm, iterator=iterator, loader=self._loader, variable_manager=self._variable_manager) except AnsibleError, e: