Bug 1293954 - [RFE] add option to format heat <option> as human readable text
[RFE] add option to format heat <option> as human readable text
Status: CLOSED NOTABUG
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-heatclient (Show other bugs)
7.0 (Kilo)
All All
unspecified Severity medium
: ---
: 8.0 (Liberty)
Assigned To: Steve Baker
Shai Revivo
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-23 11:47 EST by Dan Yocum
Modified: 2016-04-26 10:22 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-10 16:12:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Yocum 2015-12-23 11:47:13 EST
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 17:04:59 EST
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 16:12:36 EST
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.