Fix callback loading issue a slightly different way
This commit is contained in:
parent
a51c165157
commit
67671e328a
1 changed files with 10 additions and 0 deletions
|
@ -61,6 +61,8 @@ class TaskQueueManager:
|
||||||
self._stats = AggregateStats()
|
self._stats = AggregateStats()
|
||||||
self.passwords = passwords
|
self.passwords = passwords
|
||||||
self._stdout_callback = stdout_callback
|
self._stdout_callback = stdout_callback
|
||||||
|
|
||||||
|
self._callbacks_loaded = False
|
||||||
self._callback_plugins = []
|
self._callback_plugins = []
|
||||||
|
|
||||||
# a special flag to help us exit cleanly
|
# a special flag to help us exit cleanly
|
||||||
|
@ -123,6 +125,9 @@ class TaskQueueManager:
|
||||||
only one such callback plugin will be loaded.
|
only one such callback plugin will be loaded.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
if self._callbacks_loaded:
|
||||||
|
return
|
||||||
|
|
||||||
stdout_callback_loaded = False
|
stdout_callback_loaded = False
|
||||||
if self._stdout_callback is None:
|
if self._stdout_callback is None:
|
||||||
self._stdout_callback = C.DEFAULT_STDOUT_CALLBACK
|
self._stdout_callback = C.DEFAULT_STDOUT_CALLBACK
|
||||||
|
@ -148,6 +153,8 @@ class TaskQueueManager:
|
||||||
else:
|
else:
|
||||||
self._callback_plugins.append(callback_plugin())
|
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):
|
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:
|
if prompt and default is not None:
|
||||||
|
@ -201,6 +208,9 @@ class TaskQueueManager:
|
||||||
are done with the current task).
|
are done with the current task).
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
if not self._callbacks_loaded:
|
||||||
|
self.load_callbacks()
|
||||||
|
|
||||||
if play.vars_prompt:
|
if play.vars_prompt:
|
||||||
for var in play.vars_prompt:
|
for var in play.vars_prompt:
|
||||||
if 'name' not in var:
|
if 'name' not in var:
|
||||||
|
|
Loading…
Reference in a new issue