Red Hat Bugzilla – Bug 1293954
[RFE] add option to format heat <option> as human readable text
Last modified: 2016-04-26 10:22:48 EDT
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):
Steps to Reproduce:
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.
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.
<ID> ID deployment to show the output for.
<OUTPUT NAME> Name of an output to display.
-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.