Better fix

Just use opts grains int he loader and fall back to empty dict
This commit is contained in:
Mike Place 2016-06-03 13:49:51 -06:00
parent 4e18ff7000
commit 7b50e1766e
2 changed files with 3 additions and 3 deletions

View File

@ -565,7 +565,8 @@ def render(opts, functions, states=None):
''' '''
Returns the render modules Returns the render modules
''' '''
pack = {'__salt__': functions} pack = {'__salt__': functions,
'__grains__': opts.get('grains', {})}
if states: if states:
pack['__states__'] = states pack['__states__'] = states
ret = LazyLoader( ret = LazyLoader(

View File

@ -367,11 +367,10 @@ def render(template_file, saltenv='base', sls='', argline='',
raise SaltRenderError( raise SaltRenderError(
'Unknown renderer option: {opt}'.format(opt=argline) 'Unknown renderer option: {opt}'.format(opt=argline)
) )
tmp_data = salt.utils.templates.JINJA(template_file, tmp_data = salt.utils.templates.JINJA(template_file,
to_str=True, to_str=True,
salt=_split_module_dicts(), salt=_split_module_dicts(),
grains=__opts__['grains'], grains=__grains__,
opts=__opts__, opts=__opts__,
pillar=__pillar__, pillar=__pillar__,
saltenv=saltenv, saltenv=saltenv,