centralize path list handling

move it to constants and avoid duplicating code or misinforming
developers on the nature of the data
This commit is contained in:
Brian Coca 2016-03-30 07:16:09 -07:00
commit 92d154f4ef
4 changed files with 20 additions and 18 deletions

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