trove show shows different outputs for name & id of an instance

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

Bug Description

trove show shows different outputs for name & id of an instance, the sample output is as follows:

ubuntu@testzone:~$ trove list
+--------------------------------------+-------+-----------+-------------------+--------+-----------+------+
| ID | Name | Datastore | Datastore Version | Status | Flavor ID | Size |
+--------------------------------------+-------+-----------+-------------------+--------+-----------+------+
| 37bab8ae-c734-4da3-aa18-fd41d7f807ac | test1 | mysql | 5.5 | ACTIVE | 6 | 1 |
| 49b9b6c4-27b3-43e3-bfce-296f09f444e9 | test2 | mysql | 5.5 | ACTIVE | 6 | 1 |
+--------------------------------------+-------+-----------+-------------------+--------+-----------+------+
ubuntu@testzone:~$ trove show test1
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| datastore | mysql |
| datastore_version | 5.5 |
| flavor | 6 |
| id | 37bab8ae-c734-4da3-aa18-fd41d7f807ac |
| ip | 10.0.0.2 |
| name | test1 |
| status | ACTIVE |
| volume | 1 |
+-------------------+--------------------------------------+
ubuntu@testzone:~$ trove show 37bab8ae-c734-4da3-aa18-fd41d7f807ac
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| created | 2014-10-21T09:46:50 |
| datastore | mysql |
| datastore_version | 5.5 |
| flavor | 6 |
| id | 37bab8ae-c734-4da3-aa18-fd41d7f807ac |
| ip | 10.0.0.2 |
| name | test1 |
| status | ACTIVE |
| updated | 2014-10-21T09:46:54 |
| volume | 1 |
| volume_used | 0.13 |
+-------------------+--------------------------------------+

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

the client finds the information about an instance from the method findall

https://github.com/openstack/python-troveclient/blob/master/troveclient/base.py#L221-L238

This works when used with instance id as it hits the server with the url

 http://<trove_server>:8779/v1.0/<tenant_id>/instances/<instance_id>

but when it searches for name it does a search on http://<trove_server>:8779/v1.0/<tenant_id>/instances and then finds the matching name

Now the difference arises because of the different result sets in both outputs

Like when it fetches the instances list it fetches lesser information which is then presented to printing formatter resulting in different outputs for different types on inputs

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/130150

Changed in python-troveclient:
assignee: nobody → Sushil Kumar (sushil-kumar2)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-troveclient (master)

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

commit dc21242144fdf520d065e2648c6f6d56b06fcee2
Author: Sushil Kumar <email address hidden>
Date: Wed Oct 22 07:10:34 2014 +0000

    Fixes trove show output

    Reasons:
    - trove show gives different output for id and names as input,
      as explained in bug, with name it shows less information.

    Changes:
    - Returns the object found by id after finding the matching object
      from the list of obtained instances, which results in getting
      same attributes for output
      irrespective whichever way the command is used.

    Change-Id: Ib397d5791e9a6f10c10c2ab3160401c1c7cfa214
    Closes-Bug: #1384055

Changed in python-troveclient:
status: In Progress → Fix Committed
Changed in python-troveclient:
milestone: none → 1.2.0
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-troveclient 1.0.9

This issue was fixed in the openstack/python-troveclient 1.0.9 release.

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.