glance image-import command fails with 500 error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Critical
|
Unassigned |
Bug Description
This was reported by Abhishek Kekane.
Steps to reproduce:
1. Run glance image-import <image-id> or curl -g -i -X POST http://
Reason:
1. We are passing body to post url but the controller method does not accepts body parameter. So wsgi throws error import_image() has got invalid keyword argument 'body'.
Need to make below changes in /glance/
--- a/glance/
+++ b/glance/
@@ -89,11 +89,12 @@ class ImagesControlle
return image
@utils.
- def import_image(self, req, image):
+ def import_image(self, req, image_id, body):
task_repo = self.gateway.
task_input = {}
try:
@@ -108,7 +109,7 @@ class ImagesControlle
raise webob.exc.
- return image
+ return image_id
Other problems:
1. image_id is not used anywhere
2. "import_method" passed in body is not used anywhere.
Changed in glance: | |
importance: | Undecided → Critical |
Changed in glance: | |
assignee: | Brian Rosmaita (brian-rosmaita) → nobody |
Changed in glance: | |
milestone: | pike-rc1 → pike-rc2 |
> Other problems:
> 1. image_id is not used anywhere
> 2. "import_method" passed in body is not used anywhere.
With respect to #2, we only have one import method at this point, so I think that's OK.
With respect to #1, somehow the image_id needs to get over to the task, I don't see how that's happening ATM.
> - return image
> + return image_id
This change makes sense since we don't actually have an image available. On the other hand, this call is supposed to return a 202 (Accepted). Do we need to add an image_import(self, response, result) method to the ResponseSerializer (just like the one that's currently there for delete)?