Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1425733

Summary: When passing "-f json" to the openstack command, the json output is stringified and can't be parsed by standard tools
Product: Red Hat OpenStack Reporter: Udi Kalifon <ukalifon>
Component: python-heatclientAssignee: Steve Baker <sbaker>
Status: CLOSED DUPLICATE QA Contact: Shai Revivo <srevivo>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: aschultz, jruzicka, mburns, rhel-osp-director-maint, shardy, srevivo, zbitter
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-28 19:38:50 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 Udi Kalifon 2017-02-22 09:13:40 UTC
Description of problem:
Run this command for example:
openstack stack output show -f json overcloud --all

You get an output like this:
{
  "CeilometerInternalVip": "{\n  \"output_value\": \"fd00:fd00:fd00:2000::13\", \n  \"output_key\": \"CeilometerInternalVip\", \n  \"description\": \"VIP for Ceilometer API internal endpoint\"\n}", 
  "HeatInternalVip": "{\n  \"output_value\": \"fd00:fd00:fd00:2000::13\", \n  \"output_key\": \"HeatInternalVip\", \n  \"description\": \"VIP for Heat API internal endpoint\"\n}", 
... (snipped)

Note that the output starts like a valid json object, but anything in 2nd level and downwards is printed as one long string with lots of "\n", and all the quotes are escaped also. This makes automation a lot more difficult.


Version-Release number of selected component (if applicable):
OSP10 GA


How reproducible:
100%


Expected results:
It should have looked something like this:
{
  "CeilometerInternalVip": {
    "output_value": "fd00:fd00:fd00:2000::13",
    "output_key": "CeilometerInternalVip",
    "description": "VIP for Ceilometer API internal endpoint"
  }, 
  "HeatInternalVip": {
    ...
  }
}


Additional info:
This happens when using the various clients also, not just the unified openstack client.

Comment 1 Udi Kalifon 2017-02-22 16:21:26 UTC
This is not just in the heat client. It happens also in the mistral client, for example, and I think in fact in all the clients (though I didn't test more).

Comment 3 Zane Bitter 2017-02-28 19:38:50 UTC

*** This bug has been marked as a duplicate of bug 1424600 ***