Fix expected response code of show_image_file

According to https://developer.openstack.org/api-ref/image/v2/#download-binary-image-data,
normal response codes of interface show_image_file should
be [200, 204, 206], this is to fix it.

Change-Id: I6eef7231742d873a0e727c300a9ae7f5958ac4f8
Closes-Bug: #1756264
This commit is contained in:
zhufl 2018-03-16 15:24:17 +08:00 committed by Ken'ichi Ohmichi
parent c25801a985
commit fd5a14b738
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fix show_image_file interface in v2 ImagesClient: Bug#1756264.
The expected success code of show_image_file is changed from
``200`` to ``[200, 204, 206]``.

View File

@ -161,7 +161,7 @@ class ImagesClient(rest_client.RestClient):
"""
url = 'images/%s/file' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
self.expected_success([200, 204, 206], resp.status)
return rest_client.ResponseBodyData(resp, body)
def add_image_tag(self, image_id, tag):