mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
added-highstate-output-to-slack-engine
This commit is contained in:
parent
dad2d723ca
commit
9a6e03ce6e
1 changed files with 5 additions and 1 deletions
|
@ -77,6 +77,7 @@ import salt.utils
|
|||
import salt.utils.event
|
||||
import salt.utils.http
|
||||
import salt.utils.slack
|
||||
import salt.output.highstate
|
||||
|
||||
|
||||
def __virtual__():
|
||||
|
@ -271,7 +272,10 @@ def start(token,
|
|||
ret = local.cmd('{0}'.format(target), cmd, arg=args, kwarg=kwargs, tgt_type='{0}'.format(tgt_type))
|
||||
|
||||
if ret:
|
||||
return_text = json.dumps(ret, sort_keys=True, indent=1)
|
||||
salt.output.highstate.__opts__= __opts__
|
||||
if 'color' not in salt.output.highstate.__opts__:
|
||||
salt.output.highstate.__opts__.update({"color":""})
|
||||
return_text = salt.output.highstate.output(ret)
|
||||
ts = time.time()
|
||||
st = datetime.datetime.fromtimestamp(ts).strftime('%Y%m%d%H%M%S%f')
|
||||
filename = 'salt-results-{0}.yaml'.format(st)
|
||||
|
|
Loading…
Add table
Reference in a new issue