← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1337716] Re: cannot create an image by Glance V2 API, specifying parameter "id".

 

** Changed in: glance
       Status: In Progress => Opinion

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

Title:
  cannot create an image by Glance V2 API, specifying parameter "id".

Status in OpenStack Image Registry and Delivery Service (Glance):
  Opinion

Bug description:
  Issue:

  I cannot create an image by Glance V2 API, specifying parameter "id".
  This is different from the specification.
  http://docs.openstack.org/api/openstack-image-service/2.0/content/create-image.html

  Expected:

  "id" is allocated to image, and this image is created.

  Detail:

  * Execution result

  $ curl -i -X POST -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/json' -H 'X-Auth-Token: 94dda5e987c74378a9ee455b1c45acac' http://127.0.0.1:9292/v2/images -d'{"id":"01de147c-b906-45c4-9b84-ce7a62f9ca54"}'
  HTTP/1.1 500 Internal Server Error
  Content-Type: text/plain
  Content-Length: 0
  Date: Fri, 27 Jun 2014 02:23:27 GMT
  Connection: close

  * Log

  glance-api.log

  2014-06-27 10:31:14.439 13359 DEBUG routes.middleware [f4b43959-b161-4cb4-a606-c06609d58f8c f208aaea60654eaf9e85724e38e10ecb 2a6bebe5929e46ff85d599f92731c44b - - -] Match dict: {'action': u'create', 'controller': <glance.common.wsgi.Resource object at 0xb58320cc>} __call__ /usr/lib/python2.7/dist-packages/routes/middleware.py:103
  2014-06-27 10:31:14.539 13359 INFO glance.wsgi.server [f4b43959-b161-4cb4-a606-c06609d58f8c f208aaea60654eaf9e85724e38e10ecb 2a6bebe5929e46ff85d599f92731c44b - - -] Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 389, in handle_one_response
      result = self.application(self.environ, start_response)
  ...
    File "/opt/stack/glance/glance/domain/proxy.py", line 114, in new_image
      return self.helper.proxy(self.base.new_image(**kwargs))
    File "/opt/stack/glance/glance/domain/__init__.py", line 73, in new_image
      self._check_unexpected(other_args)                     
    File "/opt/stack/glance/glance/domain/__init__.py", line 60, in _check_unexpected
      raise TypeError(msg % kwargs.keys())
  TypeError: new_image() got unexpected keywords ['id']      
  2014-06-27 10:31:14.543 13359 INFO glance.wsgi.server [f4b43959-b161-4cb4-a606-c06609d58f8c f208aaea60654eaf9e85724e38e10ecb 2a6bebe5929e46ff85d599f92731c44b - - -] 127.0.0.1 - - [27/Jun/2014 10:31:14] "POST /v2/images HTTP/1.1" 500 139 0.132006

  In addition, "glance.api.v2.images:ImagesController.create()" should catch TypeError raised by a parameter specification error.
  Return code "500" is not good in this case.

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


References