From 67671e328aeef7c0d88ee481852b9e5ad79c3699 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sat, 4 Jul 2015 00:07:17 -0400 Subject: [PATCH] Fix callback loading issue a slightly different way --- lib/ansible/executor/task_queue_manager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible/executor/task_queue_manager.py b/lib/ansible/executor/task_queue_manager.py index cdee3f045ea..2504a179fc0 100644 --- a/lib/ansible/executor/task_queue_manager.py +++ b/lib/ansible/executor/task_queue_manager.py @@ -61,6 +61,8 @@ class TaskQueueManager: self._stats = AggregateStats() self.passwords = passwords self._stdout_callback = stdout_callback + + self._callbacks_loaded = False self._callback_plugins = [] # a special flag to help us exit cleanly @@ -123,6 +125,9 @@ class TaskQueueManager: only one such callback plugin will be loaded. ''' + if self._callbacks_loaded: + return + stdout_callback_loaded = False if self._stdout_callback is None: self._stdout_callback = C.DEFAULT_STDOUT_CALLBACK @@ -148,6 +153,8 @@ class TaskQueueManager: else: self._callback_plugins.append(callback_plugin()) + self._callbacks_loaded = True + def _do_var_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None): if prompt and default is not None: @@ -201,6 +208,9 @@ class TaskQueueManager: are done with the current task). ''' + if not self._callbacks_loaded: + self.load_callbacks() + if play.vars_prompt: for var in play.vars_prompt: if 'name' not in var: