Add a function to display the highstate data from sls

This commit is contained in:
Thomas S Hatch 2012-06-15 22:30:57 -06:00
parent 658389772a
commit f176e86aec

View File

@ -154,6 +154,29 @@ def show_lowstate():
st_ = salt.state.HighState(__opts__)
return st_.compile_low_chunks()
def show_sls(mods, env='base', test=None, **kwargs):
'''
Display the state data from a specific sls or list of sls files on the
master
CLI Example::
salt '*' state.sls core,edit.vim dev
'''
opts = copy.copy(__opts__)
if not test is None:
opts['test'] = test
salt.utils.daemonize_if(opts, **kwargs)
st_ = salt.state.HighState(opts)
if isinstance(mods, string_types):
mods = mods.split(',')
high, errors = st_.render_highstate({env: mods})
if errors:
return errors
return high
def show_masterstate():
'''
Display the data gathered from the master compiled state
@ -165,6 +188,7 @@ def show_masterstate():
st_ = salt.state.RemoteHighState(__opts__, __grains__)
return st_.compile_master()
def single(fun=None, test=None, **kwargs):
'''
Execute a single state function with the named kwargs, returns False if