Setting the "extra" information for tenant

Bug #1220280 reported by Mohammad Banikazemi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Wishlist
Terry Howe

Bug Description

There is a field in keystone database (tenant table) called 'extra' and I can store key-value information in it when I use the REST API:

$ curl -X POST ... -d '{"tenant":{"name":"T1", "description":"Tenant X", "type": "XYZ", "enabled":true}}' http://localhost:35357/v2.0/tenants

Looking at the keystone table I see {type": "XYZ"} under the 'extra' column.
+----------------------------------+--------------------+----------------------------------------------+---------------+---------+-----------+
| id | name | extra | description | enabled | domain_id |
+----------------------------------+--------------------+----------------------------------------------+---------------+---------+-----------+

the "type" information can be retrieved as shown here:

$keystone tenant-get 03257eed9f8c4f768e6eeb9c58bd15ef
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Tenant X |
| enabled | True |
| id | 03257eed9f8c4f768e6eeb9c58bd15ef |
| name | T1 |
| type | XYZ |
+-------------+----------------------------------+

However, the 'extra' information for tenants *cannot* be set through the keystone client.

Revision history for this message
Dolph Mathews (dolph) wrote :

They can be generated through the python library, e.g. c.projects.create(name='foobar', arbitrary_key='value'), but the CLI doesn't support this feature today. It'd be an interesting use case for python-openstackclient ... but I'm not sure which other projects support a similar capability?

Changed in python-keystoneclient:
importance: Undecided → Wishlist
affects: python-keystoneclient → python-openstackclient
Revision history for this message
Steve Martinelli (stevemar) wrote :

Thanks dolph,

Going forward, openstackclient would be able to perform the set/unset of a key value pair.
It looks like keystoneclient has *some* support: https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/v2_0/tenants.py#L133

Revision history for this message
Dolph Mathews (dolph) wrote :

Definitely only *some* support in the v2.0 managers, but it should be 100% in the v3 managers. Server-side backend support is guaranteed to vary.

Terry Howe (thowe-g)
Changed in python-openstackclient:
assignee: nobody → Terry Howe (thowe-g)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

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

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

Reviewed: https://review.openstack.org/78737
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=70e6333e7d4b3fa87496ff3a888527693875273b
Submitter: Jenkins
Branch: master

commit 70e6333e7d4b3fa87496ff3a888527693875273b
Author: Terry Howe <email address hidden>
Date: Thu Mar 6 12:50:37 2014 -0700

    Add ability to set key value pairs in projects

    Add supporto of extra key value pairs for projects (aka tenants)
    * Added option --property key=value to create and set commands
    * Support for versions v2 and v3

    Change-Id: I84064b8b308579d1b66c83b1ed3d1a37614ec087
    Closes-Bug: #1220280

Changed in python-openstackclient:
status: In Progress → Fix Committed
Dean Troyer (dtroyer)
Changed in python-openstackclient:
milestone: none → m4
Dean Troyer (dtroyer)
Changed in python-openstackclient:
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.