Json output is not consistent for *-show commands (net-show, subnet-show, ...)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-neutronclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
on two very similar openstack basic installation I got different
output from
neutron --os-user-
In case 1) - which I would called "working" - I've got:
[{"Field": "admin_state_up", "Value": true}, {"Field": "id",
"Value": "0414cab4-
"Value": 0}, {"Field": "name", "Value": "ctlplane"}, {"Field":
"provider:
"provider:
"provider:
"router:
false}, {"Field": "status", "Value": "ACTIVE"}, {"Field":
"subnets", "Value": "56c57ed7-
{"Field": "tenant_id", "Value":
"c3701c5003
In the case 2) I've got:
{
"status": "ACTIVE",
"
"subnets": "b5f81055-
"name": "public",
"
"
"tenant_id": "471e94eac4bf4f
"
"shared": false,
"mtu": 0,
"id": "4a68d056-
"
}
The environment on 1)
LSB Version: :core-4.
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
The environment on 2)
LSB Version: :core-4.
Distributor ID: CentOS
Description: CentOS Linux release 7.1.1503 (Core)
Release: 7.1.1503
Codename: Core
The packages on 1) and 2) are similar:
1)
rpm -qa | grep -E '(cliff|
json-
openstack-
openstack-
openstack-
openstack-
python2-
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-
rsyslog-
rubygem-
2)
rpm -qa | grep -E '(cliff|
json-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
openstack-
python2-
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-
python-
rsyslog-
rubygem-
When I run the neutron command with the --debug option on 1) I can see that,
stevedore is loading json like this:
DEBUG: stevedore.extension found extension EntryPoint.
DEBUG: stevedore.extension found extension EntryPoint.
On 2) this is the opposite.
If on 2) I edit this file:
/usr/
and comment out the json show formatter, like this:
[cliff.
table = cliff.formatter
#json = cliff.formatter
shell = cliff.formatter
value = cliff.formatter
yaml = cliff.formatter
Then I get the same output than in 1)
This is problematic as I use puppet which parse the json output and
expect the first form all the time. The os minor version is the
obvious difference, but I cannot see why this should change anything
as far as stevedore is loading the plugin and displaying the result.
Any hints ?
Regards,
The expected output is 2).
The result should come from cliff json formatter, not form cliff-tablib json formatter.
cliff-tablib should not be installed. Both cliff and cliff-tablib provides json formatter.
If both are installed, you will see two 'json' when you show the help by 'neutron help net-show'.
It is not an expected situation.
neutronclient 3.1.0 does not have cliff-tablib in requirements.txt and contains cliff-tablib only in test-requiremen ts.txt.
This is the reason that cliff-tablib is not included in requirements.txt.
(Note that cliff-tablib test dependency has been removed in the master branch.)
If centos package installs cliff-tablib as a dependency of neutronclient, it should be fixed in CentOS package side.