mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add a function to display the highstate data from sls
This commit is contained in:
parent
658389772a
commit
f176e86aec
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user