Comment 4 for bug 1455620

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>