Bug 1293954

Summary: [RFE] add option to format heat <option> as human readable text
Product: Red Hat OpenStack Reporter: Dan Yocum <dyocum>
Component: python-heatclientAssignee: Steve Baker <sbaker>
Status: CLOSED NOTABUG QA Contact: Shai Revivo <srevivo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: jruzicka, mburns, rhel-osp-director-maint, shardy, yeylon, zbitter
Target Milestone: ---Keywords: FutureFeature
Target Release: 8.0 (Liberty)   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-10 21:12:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.