Trigger on_stats just once, not once for each play

Fixes #13271
This commit is contained in:
James Cammarata 2015-11-28 13:37:02 -05:00
parent a7f7f8bd29
commit 800811a15f
2 changed files with 2 additions and 3 deletions

View file

@ -183,6 +183,7 @@ class PlaybookExecutor:
finally: finally:
if self._tqm is not None: if self._tqm is not None:
self._tqm.send_callback('v2_playbook_on_stats', self._tqm._stats)
self._cleanup() self._cleanup()
if self._options.syntax: if self._options.syntax:

View file

@ -107,9 +107,7 @@ class StrategyBase:
failed_hosts = set(failed_hosts).union(self._tqm._failed_hosts.keys()) failed_hosts = set(failed_hosts).union(self._tqm._failed_hosts.keys())
unreachable_hosts = set(unreachable_hosts).union(self._tqm._unreachable_hosts.keys()) unreachable_hosts = set(unreachable_hosts).union(self._tqm._unreachable_hosts.keys())
# send the stats callback # return the appropriate code, depending on the status hosts after the run
self._tqm.send_callback('v2_playbook_on_stats', self._tqm._stats)
if len(unreachable_hosts) > 0: if len(unreachable_hosts) > 0:
return 3 return 3
elif len(failed_hosts) > 0: elif len(failed_hosts) > 0: