Embedded JSON in trove CLI users list

Bug #1238216 reported by Daniel Morris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-troveclient
Fix Released
Medium
Auston McReynolds

Bug Description

In the new trove CLI, there is embedded JSON in the response table for listing users. This should be changed to send back a comma separated list of db's the user has access to.

EXAMPLE RESPONSE:

+---------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name | host | databases |
+---------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| daniel | 192.168.1.1 | [{u'name': u'test'}, {u'name': u'test1'}, {u'name': u'test10'}, {u'name': u'test11'}, {u'name': u'test12'}, {u'name': u'test13'}, {u'name': u'test14'}, {u'name': u'test15'}, {u'name': u'test16'}, {u'name': u'test17'}, {u'name': u'test19'}, {u'name': u'test2'}, {u'name': u'test20'}, {u'name': u'test21'}, {u'name': u'test3'}, {u'name': u'test4'}, {u'name': u'test5'}, {u'name': u'test6'}, {u'name': u'test7'}, {u'name': u'test8'}, {u'name': u'test9'}] |
| daniel.morris | % | [] |
| test | % | [{u'name': u'test'}, {u'name': u'test1'}, {u'name': u'test10'}, {u'name': u'test5'}, {u'name': u'test6'}] |
+---------------+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Changed in python-troveclient:
status: New → Confirmed
Changed in python-troveclient:
assignee: nobody → Auston McReynolds (amcrn)
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/53810

Changed in python-troveclient:
status: Confirmed → In Progress
Revision history for this message
Auston McReynolds (amcrn) wrote :
Download full text (3.4 KiB)

Found more instances of this issue:

- trove secgroup-list [rules]
- trove secgroup-show [rules]

convert => [{u'to_port': 3306, u'cidr': u'0.0.0.0/0', u'from_port': 3306, u'protocol': u'tcp', u'id': u'4'}]
to => to_port=3306, cidr=0.0.0.0/0, from_port=3306, protocol=tcp, id=4

- show [ip]

convert => [u'10.0.0.2']
to => 10.0.0.2

$ trove secgroup-list
+----+-----------------------------------------+---------------------------------------------------------------------------------------------------+--------------------------------------+
| id | name | rules | instance_id |
+----+-----------------------------------------+---------------------------------------------------------------------------------------------------+--------------------------------------+
| 8 | SG_45f6bc02-0d84-46e1-83e6-db7f3f064677 | [{u'to_port': 3306, u'cidr': u'0.0.0.0/0', u'from_port': 3306, u'protocol': u'tcp', u'id': u'4'}] | 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
+----+-----------------------------------------+---------------------------------------------------------------------------------------------------+--------------------------------------+

$ trove secgroup-show 8
+-------------+---------------------------------------------------------------------------------------------------+
| Property | Value |
+-------------+---------------------------------------------------------------------------------------------------+
| created | 2013-10-23T06:49:55 |
| description | Security Group for 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
| id | 8 |
| instance_id | 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
| name | SG_95f6bc02-0d84-46e1-83e6-db7f3f064677 |
| rules | [{u'to_port': 3306, u'cidr': u'0.0.0.0/0', u'from_port': 3306, u'protocol': u'tcp', u'id': u'4'}] |
| updated | 2013-10-23T06:49:55 |
+-------------+---------------------------------------------------------------------------------------------------+

$ trove show 95f6bc02-0d84-46e1-83e6-db7f3f064677
+----------+--------------------------------------+
| Property | Value |
+----------+--------------------------------------+
| created | 2013-10-23T06:49:55 |
| flavor | 9 |
| id | 95f6bc02-0d84-46e1-83e6-db7f3f064677 |
| ip | [u'10.0.0.2'] |
| name | TestTest |
| status | ACTIVE |
| updated | 2013-10-23T06:49:58 |
| volume | 5 ...

Read more...

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

Reviewed: https://review.openstack.org/53810
Committed: http://github.com/openstack/python-troveclient/commit/24783a52d950e55ad104bd6c2d4ccb123347186f
Submitter: Jenkins
Branch: master

commit 24783a52d950e55ad104bd6c2d4ccb123347186f
Author: amcrn <email address hidden>
Date: Fri Oct 25 01:40:30 2013 -0700

    user-list Databases Value is JSON vs a String

    changes the 'databases' value returned in user-list from json to
    a string of comma separated values

    $ trove user-list <instance_uuid>

    before:
    +------+------+-----------------------------------------------+
    | name | host | databases |
    +------+------+-----------------------------------------------+
    | bob | % | [{u'name': u'monkey'}] |
    | tom | % | [{u'name': u'freshdb'}, {u'name': u'monkey'}] |
    +------+------+-----------------------------------------------+

    after:
    +------+------+-----------------+
    | name | host | databases |
    +------+------+-----------------+
    | bob | % | monkey |
    | tom | % | freshdb, monkey |
    +------+------+-----------------+

    Change-Id: I8e18e05b722be8a65a15f9ed15264d48d50ecc4e
    Closes-Bug: #1238216

Changed in python-troveclient:
status: In Progress → Fix Committed
Changed in python-troveclient:
status: Fix Committed → Fix Released
importance: Undecided → Medium
milestone: none → python-troveclient-v1
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.