Call mod_init when invoking state.single

This ensures that mod_init is run when state.single is invoked.
salt.state.State.call_chunk() is what runs mod_init, but call_chunk() is
not invoked by state.single since requisites do not need to be resolved.

This commit adds a call to salt.state.State._mod_init() just before
salt.state.State.call() is invoked, making sure that the state's
mod_init() function is called like it is in state.sls and
state.highstate.
This commit is contained in:
Erik Johnson 2014-03-12 14:54:11 -05:00
parent 1aa991c71f
commit 8f4e3e68b6

View File

@ -719,6 +719,7 @@ def single(fun, name, test=None, queue=False, **kwargs):
__context__['retcode'] = 1
return err
st_._mod_init(kwargs)
ret = {'{0[state]}_|-{0[__id__]}_|-{0[name]}_|-{0[fun]}'.format(kwargs):
st_.call(kwargs)}
_set_retcode(ret)