← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1708702] [NEW] glance image-import command fails with 500 error

 

Public bug reported:

This was reported by Abhishek Kekane.

Steps to reproduce:
1. Run glance image-import <image-id> or curl -g -i -X POST http://10.232.48.204/image/v2/images/6d5851f8-bdd2-43d0-a3ee-3b4017e31b45/import -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}462b312cf75dd125706dd13acb7cbbc3eb244ca2" -d '{"import_method": "glance-direct"}'

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/api/v2/images.py
--- a/glance/api/v2/images.py
+++ b/glance/api/v2/images.py
@@ -89,11 +89,12 @@ class ImagesController(object):
         return image

     @utils.mutating
-    def import_image(self, req, image):
+    def import_image(self, req, image_id, body):
         task_factory = self.gateway.get_task_factory(req.context)
         executor_factory = self.gateway.get_task_executor_factory(req.context)
         task_repo = self.gateway.get_task_repo(req.context)

         task_input = {}

         try:
@@ -108,7 +109,7 @@ class ImagesController(object):
             LOG.debug("User not permitted to create image import task.")
             raise webob.exc.HTTPForbidden(explanation=e.msg)

-        return image
+        return image_id


Other problems:
1. image_id is not used anywhere
2. "import_method" passed in body is not used anywhere.

** Affects: glance
     Importance: Critical
     Assignee: Brian Rosmaita (brian-rosmaita)
         Status: Triaged

** Changed in: glance
   Importance: Undecided => Critical

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1708702

Title:
  glance image-import command fails with 500 error

Status in Glance:
  Triaged

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://10.232.48.204/image/v2/images/6d5851f8-bdd2-43d0-a3ee-3b4017e31b45/import -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}462b312cf75dd125706dd13acb7cbbc3eb244ca2" -d '{"import_method": "glance-direct"}'

  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/api/v2/images.py
  --- a/glance/api/v2/images.py
  +++ b/glance/api/v2/images.py
  @@ -89,11 +89,12 @@ class ImagesController(object):
           return image

       @utils.mutating
  -    def import_image(self, req, image):
  +    def import_image(self, req, image_id, body):
           task_factory = self.gateway.get_task_factory(req.context)
           executor_factory = self.gateway.get_task_executor_factory(req.context)
           task_repo = self.gateway.get_task_repo(req.context)

           task_input = {}

           try:
  @@ -108,7 +109,7 @@ class ImagesController(object):
               LOG.debug("User not permitted to create image import task.")
               raise webob.exc.HTTPForbidden(explanation=e.msg)

  -        return image
  +        return image_id

  
  Other problems:
  1. image_id is not used anywhere
  2. "import_method" passed in body is not used anywhere.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1708702/+subscriptions


Follow ups