openstack output as json end with shell line
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient |
Won't Fix
|
Wishlist
|
Yossi Ovadia |
Bug Description
When I choose to get the output as a json, the end of the print stuck with the shell line.
for example:
stack@qa-
{
"OS-EXT-
"addresses": "test_networkin
"image": "mellanox-
"OS-EXT-
"OS-EXT-
"OS-SRV-
"flavor": "m1.small (2)",
"id": "1f963466-
"security_
"volumes_
"user_id": "b970d8f569bc4e
"OS-DCF:
"accessIPv4": "",
"accessIPv6": "",
"progress": 0,
"OS-EXT-
"OS-EXT-
"config_drive": "",
"status": "ACTIVE",
"updated": "2017-03-
"hostId": "b54d2d9522e70e
"OS-EXT-
"OS-SRV-
"key_name": "test_networkin
"properties": "",
"project_id": "88fe1414d4704c
"OS-EXT-
"name": "test_networkin
"created": "2017-03-
}stack@
you can see above that json closing bracket is in same line as shell.
this happen to all commands I use.
openstack --version
openstack 3.9.0
OS Ubuntu 16.04.2 LTS
description: | updated |
Changed in python-openstackclient: | |
assignee: | nobody → Yossi Ovadia (jabadia) |
Changed in python-openstackclient: | |
status: | Triaged → Won't Fix |
In most scenario "-f json" output format is used for machine readable, the program or shell consume the result, not read it directly in console for human, the use case like:
python Popen(" openstack server list -f json")
subprocess.
Note: See openstackclient functional tests, it's a good reference for "-f json"
or
bash
#openstack server list -f json > output.json