StackStorm/st2 — pull request #883 by Kami (2014-12-09 17:12:25+00:00)
Title: CLI debug mode improvements

If `--debug` mode is used, cURL request line and raw response body will also be printed the console.

```
(virtualenv)vagrant@vagrant-ubuntu-trusty-64:/data/stanley$ python ./st2client/st2client/shell.py --debug execution list
# -------- begin 140434055391696 request ----------
curl -X GET -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-requests/2.5.0 CPython/2.7.6 Linux/3.13.0-36-generic' 'http://localhost:9101/v1/actionexecutions/?limit=50'
# -------- begin 140434055391696 response ----------
[
{
"status": "succeeded",
"start_timestamp": "2014-12-08T20:55:48.021000Z",
"parameters": {
"cmd": "date"
},
"callback": {},
"result": {
"localhost": {
"succeeded": true,
"failed": false,
"return_code": 0,
"stderr": "",
"stdout": "Mon Dec 8 20:56:29 UTC 2014"
}
},
"context": {
"user": "stanley"
},
"action": "core.local",
"id": "548610540640fd2ca3c1eb71",
"end_timestamp": "2014-12-08T20:56:29.401000Z"
},
{
"status": "succeeded",
"start_timestamp": "2014-12-08T20:55:22.204000Z",
"parameters": {
"cmd": "date"
},
"callback": {},
"result": {
"localhost": {
"succeeded": true,
"failed": false,
"return_code": 0,
"stderr": "",
"stdout": "Mon Dec 8 20:55:25 UTC 2014"
}
},
"context": {
"user": "stanley"
},
"action": "core.local",
"id": "5486103a0640fd2ca3c1eb70",
"end_timestamp": "2014-12-08T20:55:25.792000Z"
}
]
# -------- end 140434055391696 response ------------

+--------------------------+------------+--------------+-----------+------------------------------+------------------------------+
| id | action | context.user | status | start_timestamp | end_timestamp |
+--------------------------+------------+--------------+-----------+------------------------------+------------------------------+
| 5486103a0640fd2ca3c1eb70 | core.local | stanley | succeeded | Mon, 08 Dec 2014 20:55:22 | Mon, 08 Dec 2014 20:55:25 |
| | | | | UTC | UTC |
| 548610540640fd2ca3c1eb71 | core.local | stanley | succeeded | Mon, 08 Dec 2014 20:55:48 | Mon, 08 Dec 2014 20:56:29 |
| | | | | UTC | UTC |
+--------------------------+------------+--------------+-----------+------------------------------+------------------------------+
```