mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
3471796c51
1 changed files with 4 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue