Fixing up some issues with plugin loading
This commit is contained in:
parent
2a5fbd8570
commit
927072546b
4 changed files with 12 additions and 6 deletions
|
@ -60,6 +60,7 @@ class TaskQueueManager:
|
|||
self._options = options
|
||||
self._stats = AggregateStats()
|
||||
self.passwords = passwords
|
||||
self._stdout_callback = stdout_callback
|
||||
|
||||
# a special flag to help us exit cleanly
|
||||
self._terminated = False
|
||||
|
@ -73,9 +74,6 @@ class TaskQueueManager:
|
|||
|
||||
self._final_q = multiprocessing.Queue()
|
||||
|
||||
# load callback plugins
|
||||
self._callback_plugins = self._load_callbacks(stdout_callback)
|
||||
|
||||
# create the pool of worker threads, based on the number of forks specified
|
||||
try:
|
||||
fileno = sys.stdin.fileno()
|
||||
|
@ -206,6 +204,9 @@ class TaskQueueManager:
|
|||
are done with the current task).
|
||||
'''
|
||||
|
||||
# load callback plugins
|
||||
self._callback_plugins = self._load_callbacks(self._stdout_callback)
|
||||
|
||||
if play.vars_prompt:
|
||||
for var in play.vars_prompt:
|
||||
if 'name' not in var:
|
||||
|
|
|
@ -37,7 +37,7 @@ from ansible.playbook.helpers import load_list_of_blocks
|
|||
from ansible.playbook.role.include import RoleInclude
|
||||
from ansible.playbook.role.metadata import RoleMetadata
|
||||
from ansible.playbook.taggable import Taggable
|
||||
from ansible.plugins import get_all_plugin_loaders
|
||||
from ansible.plugins import get_all_plugin_loaders, push_basedir
|
||||
from ansible.utils.vars import combine_vars
|
||||
|
||||
|
||||
|
@ -136,6 +136,8 @@ class Role(Base, Become, Conditional, Taggable):
|
|||
self._variable_manager = role_include.get_variable_manager()
|
||||
self._loader = role_include.get_loader()
|
||||
|
||||
push_basedir(self._role_path)
|
||||
|
||||
if parent_role:
|
||||
self.add_parent(parent_role)
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ from ansible.inventory.group import Group
|
|||
from ansible.playbook.handler import Handler
|
||||
from ansible.playbook.helpers import load_list_of_blocks
|
||||
from ansible.playbook.role import ROLE_CACHE, hash_params
|
||||
from ansible.plugins import filter_loader, lookup_loader, module_loader
|
||||
from ansible.plugins import _basedirs, filter_loader, lookup_loader, module_loader
|
||||
from ansible.utils.debug import debug
|
||||
|
||||
|
||||
|
@ -44,6 +44,7 @@ class SharedPluginLoaderObj:
|
|||
the forked processes over the queue easier
|
||||
'''
|
||||
def __init__(self):
|
||||
self.basdirs = _basedirs[:]
|
||||
self.filter_loader = filter_loader
|
||||
self.lookup_loader = lookup_loader
|
||||
self.module_loader = module_loader
|
||||
|
|
|
@ -29,7 +29,7 @@ from jinja2.runtime import StrictUndefined
|
|||
|
||||
from ansible import constants as C
|
||||
from ansible.errors import AnsibleError, AnsibleFilterError, AnsibleUndefinedVariable
|
||||
from ansible.plugins import filter_loader, lookup_loader
|
||||
from ansible.plugins import _basedirs, filter_loader, lookup_loader
|
||||
from ansible.template.safe_eval import safe_eval
|
||||
from ansible.template.template import AnsibleJ2Template
|
||||
from ansible.template.vars import AnsibleJ2Vars
|
||||
|
@ -60,6 +60,8 @@ class Templar:
|
|||
self._available_variables = variables
|
||||
|
||||
if shared_loader_obj:
|
||||
global _basedirs
|
||||
_basedirs = shared_loader_obj.basedirs[:]
|
||||
self._filter_loader = getattr(shared_loader_obj, 'filter_loader')
|
||||
self._lookup_loader = getattr(shared_loader_obj, 'lookup_loader')
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue