Value error from self.img_client.get_image("")
We wanna get error code from server.
-REST API
https://servers.api.openstack.com/v1.1/{tenantId}/images/{imageId}
-Error
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/openstack/workspace/openstack-integration-tests/medium/tests/test_images.py", line 1000, in test_get_image_when_image_id_is_empty_string
self.img_client.get_image(image_id)
File "/home/openstack/workspace/openstack-integration-tests/storm/services/nova/json/images_client.py", line 75, in get_image
body = json.loads(body)
File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 363, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 4 - line 5 column 4 (char 4 - 52)
----------------------------------------------------------------------
This is fixed in my latest submission. The error is because the error body couldn't be parsed. Instead, I raise an exception from the rest client specific to the error code and include the error message.
https:/ /review. openstack. org/#change, 2094