mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better fix
Just use opts grains int he loader and fall back to empty dict
This commit is contained in:
parent
4e18ff7000
commit
7b50e1766e
2 changed files with 3 additions and 3 deletions
|
@ -565,7 +565,8 @@ def render(opts, functions, states=None):
|
|||
'''
|
||||
Returns the render modules
|
||||
'''
|
||||
pack = {'__salt__': functions}
|
||||
pack = {'__salt__': functions,
|
||||
'__grains__': opts.get('grains', {})}
|
||||
if states:
|
||||
pack['__states__'] = states
|
||||
ret = LazyLoader(
|
||||
|
|
|
@ -367,11 +367,10 @@ def render(template_file, saltenv='base', sls='', argline='',
|
|||
raise SaltRenderError(
|
||||
'Unknown renderer option: {opt}'.format(opt=argline)
|
||||
)
|
||||
|
||||
tmp_data = salt.utils.templates.JINJA(template_file,
|
||||
to_str=True,
|
||||
salt=_split_module_dicts(),
|
||||
grains=__opts__['grains'],
|
||||
grains=__grains__,
|
||||
opts=__opts__,
|
||||
pillar=__pillar__,
|
||||
saltenv=saltenv,
|
||||
|
|
Loading…
Add table
Reference in a new issue