Formatter is broken in json output on single entities

Bug #1625518 reported by Alexandr Kostrikov on 2016-09-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
High
Bulat Gaifullin
Mitaka
High
Bulat Gaifullin
Newton
High
Bulat Gaifullin

Bug Description

When I am trying to get information in json format I get a lot of messed information.

[root@nailgun ~]# fuel2 env show 1 -f json
[{"Field": "id", "Value": 1}, {"Field": "status", "Value": "new"}, {"Field": "fuel_version", "Value": "9.1"}, {"Field": "name", "Value": "test"}, {"Field": "release_id", "Value": 2}, {"Field": "is_customized", "Value": false}, {"Field": "changes", "Value": [{"node_id": null, "name": "attributes"}, {"node_id": null, "name": "networks"}, {"node_id": null, "name": "vmware_attributes"}]}]
[root@nailgun ~]#

Expected result:
Json output is kept simple and readable.

Additional info:
A lot of CI tests are bound to json output. It may cause a lot of failures.

The reason is in wrong formatter loading. Formatters provided by different python packages.
We have the same entry points provided by the cliff and cliff-tab packages: [1], [2].
Formatters in cliff are loaded by stevedore and get by name: [3], [4]. Thus if we have two entry points with same name unpredictable formatter would be used.
Last commit in cliff-tab package is dated by Jan 12, 2014. cliff-tab is required by network-checker, but it is not used in the code.

[1] https://github.com/openstack/cliff/blob/master/setup.cfg#L28-L40
[2] https://github.com/dreamhost/cliff-tablib/blob/master/setup.py#L160-L171
[3] https://github.com/openstack/stevedore/blob/master/stevedore/extension.py#L279-L291
[4] https://github.com/openstack/cliff/blob/0b1fc95247a4f46694a84ae5a8df4e94a5c5d5e0/cliff/display.py#L99

Fix proposed to branch: master
Review: https://review.openstack.org/373129

Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Alexander Kislitsky (akislitsky)
status: New → In Progress
Changed in fuel:
milestone: 9.1 → 10.0

Reviewed: https://review.openstack.org/373129
Committed: https://git.openstack.org/cgit/openstack/network-checker/commit/?id=6fe2c6b425d5bae83139f4896826d8c975355781
Submitter: Jenkins
Branch: master

commit 6fe2c6b425d5bae83139f4896826d8c975355781
Author: Alexander Kislitsky <email address hidden>
Date: Tue Sep 20 13:00:43 2016 +0300

    Requirements on cliff-tab is replaced with cliff requirement.

    cliff-tab is not used in the network-checker code.
    cliff-tab provides entry points for formatters with names similar
    to provided by cliff. It breaks fuel/fuel2 client output when
    non default format is used: json, yaml, e.t.c.

    Change-Id: Ibb9f427799a3bfab92749ca5df7d148f76ac0f2f
    Partial-Bug: #1625518

Reviewed: https://review.openstack.org/373216
Committed: https://git.openstack.org/cgit/openstack/network-checker/commit/?id=5ada614316a482b6e8b1eaa167d3f9171c1dbcb5
Submitter: Jenkins
Branch: stable/mitaka

commit 5ada614316a482b6e8b1eaa167d3f9171c1dbcb5
Author: Alexander Kislitsky <email address hidden>
Date: Tue Sep 20 13:00:43 2016 +0300

    Requirements on cliff-tab is replaced with cliff requirement.

    cliff-tab is not used in the network-checker code.
    cliff-tab provides entry points for formatters with names similar
    to provided by cliff. It breaks fuel/fuel2 client output when
    non default format is used: json, yaml, e.t.c.

    Change-Id: Ibb9f427799a3bfab92749ca5df7d148f76ac0f2f
    Partial-Bug: #1625518
    (cherry picked from commit 6fe2c6b425d5bae83139f4896826d8c975355781)

tags: added: in-stable-mitaka

Fix proposed to branch: master
Review: https://review.openstack.org/373965

Changed in fuel:
assignee: Alexander Kislitsky (akislitsky) → Bulat Gaifullin (bgaifullin)

Reviewed: https://review.openstack.org/373965
Committed: https://git.openstack.org/cgit/openstack/network-checker/commit/?id=5efbc91a120ae3dc12e8751ba4bdf2644590939c
Submitter: Jenkins
Branch: master

commit 5efbc91a120ae3dc12e8751ba4bdf2644590939c
Author: Bulat Gaifullin <email address hidden>
Date: Wed Sep 21 12:40:49 2016 +0300

    Requirements on cliff-tab is replaced with cliff requirement.

    cliff-tab is not used in the network-checker code.
    cliff-tab provides entry points for formatters with names similar
    to provided by cliff. It breaks fuel/fuel2 client output when
    non default format is used: json, yaml, e.t.c.

    Change-Id: I3be7c4492305f9eda18da060cd043646732232f3
    Partial-Bug: #1625518

Reviewed: https://review.openstack.org/374058
Committed: https://git.openstack.org/cgit/openstack/network-checker/commit/?id=2dc38414ab9bc32e9dc5b1ab71bea4e4d8eb1bb3
Submitter: Jenkins
Branch: stable/mitaka

commit 2dc38414ab9bc32e9dc5b1ab71bea4e4d8eb1bb3
Author: Bulat Gaifullin <email address hidden>
Date: Wed Sep 21 12:40:49 2016 +0300

    Requirements on cliff-tab is replaced with cliff requirement.

    cliff-tab is not used in the network-checker code.
    cliff-tab provides entry points for formatters with names similar
    to provided by cliff. It breaks fuel/fuel2 client output when
    non default format is used: json, yaml, e.t.c.

    Change-Id: I3be7c4492305f9eda18da060cd043646732232f3
    Partial-Bug: #1625518
    (cherry picked from commit 5efbc91a120ae3dc12e8751ba4bdf2644590939c)

tags: added: on-verification
ElenaRossokhina (esolomina) wrote :

Verified: 9.1 snapshot 299

tags: removed: on-verification
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers