diff --git a/salt/modules/state.py b/salt/modules/state.py index 5362b19698..47bcd583d0 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -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