Format of Create Image response is malformed

Bug #751798 reported by Daryl Walleck
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ken Pepple

Bug Description

The Create Image request currently yields the following response:

{"status": "QUEUED", "updated": null, "name": "blargh", "created": "2011-04-04T18:59:56Z", "serverId": 5, "id": 17}

This response is missing the enclosing image field. The response should look like this:

{ "image": {"status": "QUEUED", "updated": null, "name": "blargh", "created": "2011-04-04T18:59:56Z", "serverId": 5, "id": 17} }

Related branches

Revision history for this message
Ken Pepple (ken-pepple) wrote :

Daryl --

what URL are you using to generate this problem (i.e. v1.1/images/123) ? I think I see the problem in nova/api/openstack/images.py:133 but I can't track down the associated tests ... if I am correct, we just need to change this line:

             return self.get_builder(req).build(image, detail=True)

to this:

             return dict(image=self.get_builder(req).build(image, detail=True))

My branch with this fix (but no tests) is attached if you want to try it.

Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Ken Pepple (ken-pepple)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Eldar Nugaev (reldan) wrote :

Hi Ken.

 We have duplicate https://bugs.launchpad.net/nova/+bug/764921.
Could you propose your branch for merge into trunk?

Eldar

Revision history for this message
Ken Pepple (ken-pepple) wrote :

sorry ... forgot about this while waiting for Daryl's response.

can you take a look at the changeset and offer your opinion on the change ? i took the least invasive approach of leaving the 1.0 response alone and updating 1.1 builder by assigning serverRef to serverId before deleting serverId from the attributes. this probably isn't the most elegant way to do it -- but didn't want to complete rewrite the 1.0 builder ...

Ken Pepple (ken-pepple)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-1
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-1 → 2011.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.