mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
insert saltenv to render_state args in state.template
This commit is contained in:
parent
2545df052a
commit
c80299b918
@ -241,13 +241,25 @@ def template(tem, queue=False, **kwargs):
|
||||
|
||||
salt '*' state.template '<Path to template on the minion>'
|
||||
'''
|
||||
if 'env' in kwargs:
|
||||
salt.utils.warn_until(
|
||||
'Boron',
|
||||
'Passing a salt environment should be done using \'saltenv\' '
|
||||
'not \'env\'. This functionality will be removed in Salt Boron.'
|
||||
)
|
||||
saltenv = kwargs['env']
|
||||
elif 'saltenv' in kwargs:
|
||||
saltenv = kwargs['saltenv']
|
||||
else:
|
||||
saltenv = ''
|
||||
|
||||
conflict = _check_queue(queue, kwargs)
|
||||
if conflict is not None:
|
||||
return conflict
|
||||
st_ = salt.state.HighState(__opts__)
|
||||
if not tem.endswith('.sls'):
|
||||
tem = '{sls}.sls'.format(sls=tem)
|
||||
high_state, errors = st_.render_state(tem, None, '', None, local=True)
|
||||
high_state, errors = st_.render_state(tem, saltenv, '', None, local=True)
|
||||
if errors:
|
||||
__context__['retcode'] = 1
|
||||
return errors
|
||||
|
Loading…
Reference in New Issue
Block a user