diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index 7d07eed7e3..41bbe14915 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -64,7 +64,10 @@ class SaltCacheLoader(BaseLoader): self.opts = opts self.saltenv = saltenv self.encoding = encoding - self.searchpath = [path.join(opts['cachedir'], 'files', saltenv)] + if opts.get('file_client', 'remote') == 'local': + self.searchpath = opts['file_roots'][saltenv] + else: + self.searchpath = [path.join(opts['cachedir'], 'files', saltenv)] log.debug('Jinja search path: {0!r}'.format(self.searchpath)) self._file_client = None self.cached = []