Image Create and Update Broken

Bug #1455620 reported by Terry Howe
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack SDK
Fix Released
Critical
Ankit Agrawal

Bug Description

It looks like image create and possibly update are broken. On create, glance expects the attributes passed in the header under x-image-meta-${attribute_name} the image should be in the body.

Tags: proxy
Changed in python-openstacksdk:
importance: Undecided → Critical
milestone: none → 1.0
status: New → Confirmed
tags: added: proxy
Changed in python-openstacksdk:
assignee: nobody → Everett Toews (everett-toews)
Changed in python-openstacksdk:
status: Confirmed → In Progress
Revision history for this message
Everett Toews (everett-toews) wrote :

Unassigned myself as I'll be on vacation July 10-21.

Changed in python-openstacksdk:
assignee: Everett Toews (everett-toews) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstacksdk (master)

Reviewed: https://review.openstack.org/199318
Committed: https://git.openstack.org/cgit/stackforge/python-openstacksdk/commit/?id=1970ff156960daf1a523a4d9de20022f9c620335
Submitter: Jenkins
Branch: master

commit 1970ff156960daf1a523a4d9de20022f9c620335
Author: Everett Toews <email address hidden>
Date: Tue Jul 7 16:51:17 2015 -0500

    Image import

    Implement image import and test it.

    Change-Id: I6d3078d8881fcd63404582b37c2870f0bbf1b01e
    Partial-Bug: 1455620

Revision history for this message
Brian Curtin (brian.curtin) wrote :

Does that change complete this? I feel like it does but I can't remember what the verdict was.

Changed in python-openstacksdk:
milestone: 1.0 → none
Revision history for this message
Ankit Agrawal (ankitagrawal) wrote :

Update image raises 415 Unsupported Media Type

attrs = {'name': 'test_1'}
conn.image.update_image(<image_id>, **attrs)

Traceback (most recent call last):
  File "test_image.py", line 55, in <module>
    image_obj = conn.image.update_image('7921c9c9-8737-4f30-b67d-e68c228043fe', **attrs)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/image/v2/_proxy.py", line 103, in update_image
    return self._update(_image.Image, image, **attrs)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/proxy.py", line 36, in check
    return method(self, expected, actual, *args, **kwargs)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/proxy.py", line 160, in _update
    return res.update(self.session)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/resource.py", line 795, in update
    resp = self.update_by_id(session, self.id, dirty_attrs, path_args=self)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/resource.py", line 768, in update_by_id
    resp = session.patch(url, endpoint_filter=cls.service, **args)
  File "/usr/local/lib/python2.7/dist-packages/keystoneauth1/session.py", line 596, in patch
    return self.request(url, 'PATCH', **kwargs)
  File "/home/ubuntu/workbook/python-openstacksdk/openstack/session.py", line 63, in map_exceptions_wrapper
    http_status=e.http_status, cause=e)
openstack.exceptions.HttpException: HttpException: Unsupported Media Type, <html>
 <head>
  <title>415 Unsupported Media Type</title>
 </head>
 <body>
  <h1>415 Unsupported Media Type</h1>
  The request media type application/json is not supported by this server.
<br /><br />

 </body>
</html>

Changed in python-openstacksdk:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/319054
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=d24bebb538296894c9dc0665e5dcec7cf1aa882f
Submitter: Jenkins
Branch: master

commit d24bebb538296894c9dc0665e5dcec7cf1aa882f
Author: dineshbhor <email address hidden>
Date: Wed Apr 13 13:27:04 2016 +0000

    Fix update_image unsupported media type

    Currently update_image returns unsupported media type because
    unexpected Content-Type (application/json) being passed
    to glance service.

    Provided expected Content-Type and body with patch operations(op).
    Used make_patch() method from jsonpatch library to create patch
    for updating image.

    Closes-Bug: #1455620
    Change-Id: I3d77648d55b2870e40ff689b47574e68aa72d7f6

Changed in python-openstacksdk:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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