pushed module_loader to task_queue_manager so all cli's can benefit from it

also normalized -M option across all cli
fixes #12016
This commit is contained in:
Brian Coca 2015-08-25 18:10:03 -04:00
commit 154754ae50
7 changed files with 17 additions and 15 deletions

View file

@ -31,7 +31,7 @@ from ansible.executor.process.worker import WorkerProcess
from ansible.executor.process.result import ResultProcess
from ansible.executor.stats import AggregateStats
from ansible.playbook.play_context import PlayContext
from ansible.plugins import callback_loader, strategy_loader
from ansible.plugins import callback_loader, strategy_loader, module_loader
from ansible.template import Templar
__all__ = ['TaskQueueManager']
@ -62,6 +62,12 @@ class TaskQueueManager:
self._callbacks_loaded = False
self._callback_plugins = []
# make sure the module path (if specified) is parsed and
# added to the module_loader object
if options.module_path is not None:
for path in options.module_path.split(os.pathsep):
module_loader.add_directory(path)
# a special flag to help us exit cleanly
self._terminated = False