Prevent spurious "Template does not exist" error

This was merged previously (though slightly differently) in #39516

Took me a second to track it down and then realized that I fixed this in 2016.x
This commit is contained in:
Paul Miller 2017-08-20 09:06:39 -04:00 committed by rallytime
parent 85dba1e898
commit 842b07fd25

View File

@ -405,20 +405,19 @@ class Pillar(object):
self.opts['pillarenv'], ', '.join(self.opts['file_roots'])
)
else:
tops[self.opts['pillarenv']] = [
compile_template(
self.client.cache_file(
self.opts['state_top'],
self.opts['pillarenv']
),
self.rend,
self.opts['renderer'],
self.opts['renderer_blacklist'],
self.opts['renderer_whitelist'],
self.opts['pillarenv'],
_pillar_rend=True,
)
]
top = self.client.cache_file(self.opts['state_top'], self.opts['pillarenv'])
if top:
tops[self.opts['pillarenv']] = [
compile_template(
top,
self.rend,
self.opts['renderer'],
self.opts['renderer_blacklist'],
self.opts['renderer_whitelist'],
self.opts['pillarenv'],
_pillar_rend=True,
)
]
else:
for saltenv in self._get_envs():
if self.opts.get('pillar_source_merging_strategy', None) == "none":