diff options
author | Jason Dunsmore <jasondunsmore@gmail.com> | 2016-09-28 17:04:18 -0500 |
---|---|---|
committer | Jason Dunsmore <jasondunsmore@gmail.com> | 2016-09-30 15:03:23 -0500 |
commit | 272c32f7ecc4b0dc16eaf893ccc534e01b45a2a1 (patch) | |
tree | 3c1731d26c05cc78babebed55bbcc0222d552687 /heatclient/v1 | |
parent | 9a255f593c2758530ab9f4bcd31a2828e690b569 (diff) | |
download | python-heatclient-272c32f7ecc4b0dc16eaf893ccc534e01b45a2a1.tar.gz |
Fix "heat output-show -F json" output format
So that it matches the equivalent OSC command's output. Also change
the default output-show format to 'raw' to maintain current behavior.
Closes-Bug: #1560087
Change-Id: Ia03b1633565881b4b4a7f95e7b0c5df472487f62
Diffstat (limited to 'heatclient/v1')
-rw-r--r-- | heatclient/v1/shell.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 99a33f9..35a9102 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -728,7 +728,7 @@ def do_output_list(hc, args): help=_('Name of an output to display.')) @utils.arg('-F', '--format', metavar='<FORMAT>', help=_('The output value format, one of: json, raw.'), - default='json') + default='raw') @utils.arg('-a', '--all', default=False, action='store_true', help=_('Display all stack outputs.')) @utils.arg('--with-detail', default=False, action="store_true", @@ -771,11 +771,11 @@ def do_output_show(hc, args): } utils.print_dict(output['output'], formatters=formatters) else: - if (args.format == 'json' - or isinstance(output['output']['output_value'], dict) - or isinstance(output['output']['output_value'], list)): - print( - utils.json_formatter(output['output']['output_value'])) + if args.format == 'json': + print(utils.json_formatter(output['output'])) + elif (isinstance(output['output']['output_value'], dict) + or isinstance(output['output']['output_value'], list)): + print(utils.json_formatter(output['output']['output_value'])) else: print(output['output']['output_value']) |