<div dir="ltr">You hit <a href="https://bugs.launchpad.net/python-neutronclient/+bug/1524624">https://bugs.launchpad.net/python-neutronclient/+bug/1524624</a>.<div>The current neutronclient formats an object to string even if non-table format is specified.</div><div><a href="https://review.openstack.org/#/c/255696/">https://review.openstack.org/#/c/255696/</a> is the fix but it lacks reviewers for 10 months :(<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-30 18:16 GMT+09:00 Kevin Benton <span dir="ltr"><<a href="mailto:kevin@benton.pub" target="_blank">kevin@benton.pub</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Looks very much like a bug (double json encoding). File a bug on launchpad against python-neutronclient. </p>
<div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sep 30, 2016 05:10, "Bill Nerenberg" <<a href="mailto:bill.nerenberg75@gmail.com" target="_blank">bill.nerenberg75@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div><div>Hi all<br><br></div>When I run neutron -f json in the command below, the pools value is quoted so I cannot use it with JSON parsers like jq<br><br>For example, this is neutron's problematic output [1] (see the pools line)<br><br>$ neutron lbaas-loadbalancer-show ef315cff-1d0a-4327-93c6-e9bf7e<wbr>544e2d -f json <br>{<br>  "description": "", <br>  "admin_state_up": false, <br>  "tenant_id": "1bcf7ba13bcb496196d72f481bfeb<wbr>b5c", <br>  "provisioning_status": "ACTIVE", <br>  "vip_subnet_id": "d02c8267-30be-4cdc-aa4a-a7c1c<wbr>a6504b8", <br>  "listeners": "", <br>  "vip_address": "10.0.2.160", <br>  "vip_port_id": "07227a77-1afe-466b-9d54-20e86<wbr>37fc2b0", <br>  "provider": "f5networks", <br>  "pools": "{\"id\": \"1b792ace-0cbf-47cc-a3d5-2140<wbr>c570ccee\"}", <br>  "id": "ef315cff-1d0a-4327-93c6-e9bf7<wbr>e544e2d", <br>  "operating_status": "ONLINE", <br>  "name": "test-lbaasv2"<br>}<br><br></div>Which triggers an error in jq (or other tools)<br><br>neutron lbaas-loadbalancer-show ef315cff-1d0a-4327-93c6-e9bf7e<wbr>544e2d -f json | jq ".<a href="http://pools.id" target="_blank">pools.id</a>"<br>jq: error: Cannot index string with string<br><br><br></div>If instead I use the followin JSON without the double quotes it works just fine<br><br>$ cat myjson<br>{<br>  "description": "", <br>  "admin_state_up": false, <br>  "tenant_id": "1bcf7ba13bcb496196d72f481bfeb<wbr>b5c", <br>  "provisioning_status": "ACTIVE", <br>  "vip_subnet_id": "d02c8267-30be-4cdc-aa4a-a7c1c<wbr>a6504b8", <br>  "listeners": "", <br>  "vip_address": "10.0.2.160", <br>  "vip_port_id": "07227a77-1afe-466b-9d54-20e86<wbr>37fc2b0", <br>  "provider": "f5networks", <br>  "pools": {"id": "1b792ace-0cbf-47cc-a3d5-2140c<wbr>570ccee"}, <br>  "id": "ef315cff-1d0a-4327-93c6-e9bf7<wbr>e544e2d", <br>  "operating_status": "ONLINE", <br>  "name": "test-lbaasv2"<br>}<br>$ cat myjson | jq ".<a href="http://pools.id" target="_blank">pools.id</a>"<br>"1b792ace-0cbf-47cc-a3d5-2140c<wbr>570ccee"<br><br></div>Questions, questions...<br><br></div>Is it intentional the output of [1] or is it a bug? If it is not a bug and it is intentional... how is it expected we should be parsing it?<br><br></div>Comments would be greatly appreciated<br><br></div><div>Many thanks<br><br><br></div><div><br></div><div><div><div><div><div><div><br></div></div></div></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
<br></blockquote></div></div>
<br>______________________________<wbr>_________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack</a><br>
<br></blockquote></div><br></div>