Volume-transfer Creation doesn't support 'name' specified via xml format

Bug #1243613 reported by wingwj on 2013-10-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Medium
Avishay Traeger

Bug Description

Volume-transfer creation provides to specify the 'name' param in cinder.

I tested it on json format, everything's ok.
But when I create it on xml format, the 'name' param is not transmitted to Cinder.

--------------
Here is input-body of my test:

    <transfer name="transfer6" volume_id="8d37404a-4d60-466c-a8b8-78501db208da"/>

Here's the result, you can found the 'name' is 'None' in response.

<?xml version='1.0' encoding='UTF-8'?>
<transfer
    xmlns:os-volume-transfer="http://docs.openstack.org/volume/ext/volume-transfer/api/v1.1" auth_key="9266c59563c84774" created_at="2013-10-23 07:59:07.231575" id="7e7d872b-791a-40a6-887f-9b718b4e04b0" name="None" volume_id="8d37404a-4d60-466c-a8b8-78501db208da"/>
--------------

The reason is due to the inconsistent processing between xml and json.

The CreateDeserializer of xml-format uses 'display_name' param, not 'name':
        --> attributes = ['volume_id', 'display_name']
But the processing of create() in volume-transfer, uses 'name' not 'display_name':
        --> name = transfer.get('name', None)

Therefore, no matter the 'name' is specified, its value in response will also be 'None'.

wingwj (wingwj) on 2013-10-23
Changed in cinder:
assignee: nobody → wingwj (wingwj)

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

Changed in cinder:
status: New → In Progress
Mike Perez (thingee) on 2013-12-14
Changed in cinder:
milestone: none → icehouse-2
Changed in cinder:
importance: Undecided → Medium

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

Changed in cinder:
assignee: wingwj (wingwj) → Avishay Traeger (avishay-il)

Reviewed: https://review.openstack.org/66329
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ce889d99f61aecd0b4002d44866bbfff8ff6a2c3
Submitter: Jenkins
Branch: master

commit ce889d99f61aecd0b4002d44866bbfff8ff6a2c3
Author: wingwj <email address hidden>
Date: Sat Dec 14 20:00:08 2013 +0800

    Transfer creation doesn't support 'name' via xml

    Change the transfer create XML deserializer to use 'name' rather than
    'display_name'. This is in line with cinderclient and the json code.

    Change-Id: I97ba0c4411fe4a151261ed2f657465951bcb9d7b
    Closes-Bug: #1243613

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-01-22
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers