Merge pull request #44964 from Giandom/2017.7-added-highstate-output-to-slack-engine

added-highstate-output-to-slack-engine
This commit is contained in:
Nicole Thomas 2017-12-21 16:32:01 -05:00 committed by GitHub
commit f41adfc913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)