mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #20738 from donjohnson/patch-1
Allow for indented/pretty-printed json output from jinja/simplejson
This commit is contained in:
commit
14d9c9565b
@ -365,8 +365,8 @@ class SerializerExtension(Extension, object):
|
||||
return data
|
||||
return explore(data)
|
||||
|
||||
def format_json(self, value, sort_keys=True):
|
||||
return Markup(json.dumps(value, sort_keys=sort_keys).strip())
|
||||
def format_json(self, value, sort_keys=True, indent=None):
|
||||
return Markup(json.dumps(value, sort_keys=sort_keys, indent=indent).strip())
|
||||
|
||||
def format_yaml(self, value, flow_style=True):
|
||||
return Markup(yaml.dump(value, default_flow_style=flow_style,
|
||||
|
Loading…
Reference in New Issue
Block a user