Merge pull request #45819 from Giandom/oxygen-added-highstate-output-to-slack-engine

oxygen-added-highstate-output-to-slack-engine
This commit is contained in:
Nicole Thomas 2018-02-01 13:38:41 -05:00 committed by GitHub
commit 3471796c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -563,20 +563,11 @@ class SlackClient(object):
'''
Print out YAML using the block mode
'''
params = {}
if 'output_indent' not in __opts__:
# default indentation
params.update(default_flow_style=False)
elif __opts__['output_indent'] >= 0:
# custom indent
params.update(default_flow_style=False,
indent=__opts__['output_indent'])
else: # no indentation
params.update(default_flow_style=True,
indent=0)
try:
#return salt.utils.yaml.safe_dump(data, **params).replace("\n\n", "\n")
return salt.utils.json.dumps(data, 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 salt.output.highstate.output(data)
# pylint: disable=broad-except
except Exception as exc:
import pprint