Bug 1293954 - [RFE] add option to format heat <option> as human readable text
Summary: [RFE] add option to format heat <option> as human readable text
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-heatclient
Version: 7.0 (Kilo)
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: 8.0 (Liberty)
Assignee: Steve Baker
QA Contact: Shai Revivo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-23 16:47 UTC by Dan Yocum
Modified: 2016-04-26 14:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-10 21:12:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan Yocum 2015-12-23 16:47:13 UTC
Description of problem:

'heat resource-show' output is horrible.  Let's make it better.

Please add an option to make it human readable, -h --human-readable, which does the following (essentially):


heat deployment-show 515ea2a2-4212-47c5-a763-89465966676c | perl -pe 's#\\u001b\[[0m]##g; s#\\u001b\[1;31m##g; s#\\n#\n#g;'


This perl regex substitution removes special colored characters and replaces newline and return characters with POSIX newlines.  The output is human readable.

Version-Release number of selected component (if applicable):

7.1

How reproducible:

always

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Zane Bitter 2016-01-06 22:04:59 UTC
python-openstackclient will probably solve this problem for us in the future, since it provides multiple output formats (including json, csv, &c.) for every command.

In the meantime, it might be worth it to have some special cases. Assuming the command in question here is "heat deployment-show" (the description is ambiguous) then maybe something like "heat deployment-show-output" that just prints the raw output is needed.

Comment 3 Steve Baker 2016-01-10 21:12:36 UTC
It sounds like you're using resource-show to view the output of a deployment execution. You should probably be using these commands instead:

  heat deployment-output-show -F raw <deployment uuid> deploy_stdout
  heat deployment-output-show -F raw <deployment uuid> deploy_stderr

$ heat deployment-output-show --help
usage: heat deployment-output-show [-a] [-F <FORMAT>] <ID> [<OUTPUT NAME>]

Show a specific deployment output.

Positional arguments:
  <ID>                  ID deployment to show the output for.
  <OUTPUT NAME>         Name of an output to display.

Optional arguments:
  -a, --all             Display all deployment outputs.
  -F <FORMAT>, --format <FORMAT>
                        The output value format, one of: raw, json

I'm going to mark this CLOSED, assuming the above advice fits your needs.


Note You need to log in before you can comment on or make changes to this bug.