mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Properly use test_loader from SharedPluginLoaderObj
This commit is contained in:
parent
cb9f350c8f
commit
45b803efb4
2 changed files with 5 additions and 2 deletions
|
@ -35,7 +35,7 @@ from ansible.playbook.handler import Handler
|
|||
from ansible.playbook.helpers import load_list_of_blocks
|
||||
from ansible.playbook.included_file import IncludedFile
|
||||
from ansible.playbook.role import hash_params
|
||||
from ansible.plugins import action_loader, connection_loader, filter_loader, lookup_loader, module_loader
|
||||
from ansible.plugins import action_loader, connection_loader, filter_loader, lookup_loader, module_loader, test_loader
|
||||
from ansible.template import Templar
|
||||
from ansible.vars.unsafe_proxy import wrap_var
|
||||
|
||||
|
@ -59,6 +59,7 @@ class SharedPluginLoaderObj:
|
|||
self.action_loader = action_loader
|
||||
self.connection_loader = connection_loader
|
||||
self.filter_loader = filter_loader
|
||||
self.test_loader = test_loader
|
||||
self.lookup_loader = lookup_loader
|
||||
self.module_loader = module_loader
|
||||
|
||||
|
|
|
@ -130,9 +130,11 @@ class Templar:
|
|||
|
||||
if shared_loader_obj:
|
||||
self._filter_loader = getattr(shared_loader_obj, 'filter_loader')
|
||||
self._test_loader = getattr(shared_loader_obj, 'test_loader')
|
||||
self._lookup_loader = getattr(shared_loader_obj, 'lookup_loader')
|
||||
else:
|
||||
self._filter_loader = filter_loader
|
||||
self._test_loader = test_loader
|
||||
self._lookup_loader = lookup_loader
|
||||
|
||||
# flags to determine whether certain failures during templating
|
||||
|
@ -183,7 +185,7 @@ class Templar:
|
|||
if self._tests is not None:
|
||||
return self._tests.copy()
|
||||
|
||||
plugins = [x for x in test_loader.all()]
|
||||
plugins = [x for x in self._test_loader.all()]
|
||||
|
||||
self._tests = dict()
|
||||
for fp in plugins:
|
||||
|
|
Loading…
Reference in a new issue