volume type on create is name in request, and id in resp

Bug #1071436 reported by clayg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
clayg

Bug Description

request body:
{"status": "creating", "availability_zone": null, "display_description": null, "snapshot_id": null, "user_id": null, "size": 1, "display_name": null, "imageRef": null, "attach_status": "detached", "volume_type": "vtype", "project_id": null, "metadata": {}}}

response:
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| created_at | 2012-10-25T18:26:14.275828 |
| display_description | None |
| display_name | None |
| id | b1f383b0-6470-4e8a-9e02-56728b0b4501 |
| metadata | {} |
| size | 1 |
| snapshot_id | None |
| status | available |
| volume_type | 1 |
+---------------------+--------------------------------------+

then on show it's fixed:
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| created_at | 2012-10-25T18:26:14.275828 |
| display_description | None |
| display_name | None |
| id | b1f383b0-6470-4e8a-9e02-56728b0b4501 |
| metadata | {} |
| size | 1 |
| snapshot_id | None |
| status | available |
| volume_type | vtype |
+---------------------+--------------------------------------+

since volume_type is a backref on the model, you have to iter when creating the dict

Can we fix in v1.0 or do we have to wait for v1.1 ???

Tags: type
Revision history for this message
clayg (clay-gerrard) wrote :
Revision history for this message
Vish Ishaya (vishvananda) wrote :

tough call, but I would consider this a bugfix for 1.0

Changed in cinder:
status: New → Triaged
importance: Undecided → Low
Changed in cinder:
milestone: none → grizzly-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/15145
Committed: http://github.com/openstack/cinder/commit/ecc664dca2c6844a7963da63d3495281ef5866c8
Submitter: Jenkins
Branch: master

commit ecc664dca2c6844a7963da63d3495281ef5866c8
Author: Clay Gerrard <email address hidden>
Date: Wed Oct 31 15:25:55 2012 -0500

    Return volume type name on volume create

    Update openstack api controller for volumes to fully inflate the
    returned volume model on create to populate the volume_type fields so
    the response serializer will return the name of the volume_type instead
    of the id on volume create requests. Returning the name on create is
    consistent with the show and index commands.

    fixes bug #1071436

    Change-Id: Ie091cf824a2df40211d8bcfa7f177fc851d737f5

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-1 → 2013.1
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.