mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Merge pull request #15208 from bcoca/constants_pathlist
centralize path list handling
This commit is contained in:
commit
4b3257c4fe
4 changed files with 20 additions and 18 deletions
|
@ -158,8 +158,7 @@ class PluginLoader:
|
|||
|
||||
# look in any configured plugin paths, allow one level deep for subcategories
|
||||
if self.config is not None:
|
||||
configured_paths = self.config.split(os.pathsep)
|
||||
for path in configured_paths:
|
||||
for path in self.config:
|
||||
path = os.path.realpath(os.path.expanduser(path))
|
||||
contents = glob.glob("%s/*" % path) + glob.glob("%s/*/*" % path)
|
||||
for c in contents:
|
||||
|
|
|
@ -123,7 +123,8 @@ class ActionModule(ActionBase):
|
|||
# loader, so that it knows about the other paths to find template files
|
||||
searchpath = [self._loader._basedir, os.path.dirname(source)]
|
||||
if self._task._role is not None:
|
||||
searchpath.insert(1, C.DEFAULT_ROLES_PATH)
|
||||
if C.DEFAULT_ROLES_PATH:
|
||||
searchpath[:0] = C.DEFAULT_ROLES_PATH
|
||||
searchpath.insert(1, self._task._role._role_path)
|
||||
|
||||
self._templar.environment.loader.searchpath = searchpath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue