troveclient is showing output for various commands in dictionary format

Bug #1322461 reported by Sushil Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-troveclient
Fix Released
High
Sushil Kumar

Bug Description

troveclient is showing output for various commands in dictionary format instead of earlier row-column format.

for example

The current output is

$ trove list
[
  {
    "status": "ACTIVE",
    "name": "test_vm_2014May08091518",
    "links": [
      {
        "href": "https://10.1.0.8:8779/v1.0/5cc7f344990e4543adf2c329120ec3c1/instances/77dd24cc-3136-4386-89b8-4f674b33d8c7",
        "rel": "self"
      },
      {
        "href": "https://10.1.0.8:8779/instances/77dd24cc-3136-4386-89b8-4f674b33d8c7",
        "rel": "bookmark"
      }
    ],
    "volume": {
      "size": 2
    },
    "flavor": {
      "id": "6",
      "links": [
        {
          "href": "https://10.1.0.8:8779/v1.0/5cc7f344990e4543adf2c329120ec3c1/flavors/6",
          "rel": "self"
        },
        {
          "href": "https://10.1.0.8:8779/flavors/6",
          "rel": "bookmark"
        }
      ]
    },
    "id": "77dd24cc-3136-4386-89b8-4f674b33d8c7",
    "datastore": {
      "version": "5.5",
      "type": "mysql"
    }
  },
  {
    "status": "ACTIVE",
    "name": "test_vm_2014May12080822",
    "links": [
      {
        "href": "https://10.1.0.8:8779/v1.0/5cc7f344990e4543adf2c329120ec3c1/instances/c2dc18df-6641-4c6a-a3f4-f7cc9ca65be2",
        "rel": "self"
      },
      {
        "href": "https://10.1.0.8:8779/instances/c2dc18df-6641-4c6a-a3f4-f7cc9ca65be2",
        "rel": "bookmark"
      }
    ],
    "volume": {
      "size": 2
    },
    "flavor": {
      "id": "6",
      "links": [
        {
          "href": "https://10.1.0.8:8779/v1.0/5cc7f344990e4543adf2c329120ec3c1/flavors/6",
          "rel": "self"
        },
        {
          "href": "https://10.1.0.8:8779/flavors/6",
          "rel": "bookmark"
        }
      ]
    },
    "id": "c2dc18df-6641-4c6a-a3f4-f7cc9ca65be2",
    "datastore": {
      "version": "5.5",
      "type": "mysql"
    }
  }
]

whereas the expected output is
$ trove list
+--------------------------------------+-------------------------+-----------+-------------------+--------+-----------+------+
| ID | Name | Datastore | Datastore Version | Status | Flavor ID | Size |
+--------------------------------------+-------------------------+-----------+-------------------+--------+-----------+------+
| 77dd24cc-3136-4386-89b8-4f674b33d8c7 | test_vm_2014May08091518 | mysql | 5.5 | ACTIVE | 6 | 2 |
| c2dc18df-6641-4c6a-a3f4-f7cc9ca65be2 | test_vm_2014May12080822 | mysql | 5.5 | ACTIVE | 6 | 2 |
+--------------------------------------+-------------------------+-----------+-------------------+--------+-----------+------+

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-troveclient (master)

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

Changed in python-troveclient:
assignee: nobody → Sushil Kumar (sushil-kumar2)
status: New → In Progress
description: updated
summary: - troveclient is showing output for various commands in json format
+ troveclient is showing output for various commands in dictionary format
Changed in python-troveclient:
importance: Undecided → High
milestone: none → juno-1
Revision history for this message
Peter Stachowski (peterstac) wrote :

Looks like the change to utils.py:121 in https://review.openstack.org/#/c/66369 introduced this:

   if 'json_output' in globals():

should probably be restored to:

   if 'json_output' in globals() and json_output:

Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

Yes Peter, the bug was produced by that change, but if we restore that it wud produce flake8 F821 error, so a change has been proposed with a slight change, please review the same.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-troveclient (master)

Reviewed: https://review.openstack.org/95094
Committed: https://git.openstack.org/cgit/openstack/python-troveclient/commit/?id=f4e970dfcab338d52a90d5726bcccf4272399351
Submitter: Jenkins
Branch: master

commit f4e970dfcab338d52a90d5726bcccf4272399351
Author: Sushil Kumar <email address hidden>
Date: Fri May 23 07:10:52 2014 +0000

    Corrects trove-client output

    Updates the condition to test global symbol 'json_output' and
    print results accordingly.

    Change-Id: Ib1d5d45413b4652456c05bda6304701b0ce23a06
    Closes-Bug: #1322461

Changed in python-troveclient:
status: In Progress → Fix Committed
Zhao Chao (zhaochao1984)
Changed in python-troveclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.