Merge pull request #15208 from bcoca/constants_pathlist

centralize path list handling
This commit is contained in:
Brian Coca 2016-03-30 19:49:18 -07:00
commit 4b3257c4fe
4 changed files with 20 additions and 18 deletions

View file

@ -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:

View file

@ -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