From 78195350c3069ad266b476d9a280e3d249a02558 Mon Sep 17 00:00:00 2001 From: Zhi Yan Liu Date: Wed, 13 Aug 2014 21:38:36 +0800 Subject: [PATCH] Correct content type of response for image metadata getting api The recent change [0] makes glanceclient use requests to communicate with glance server, new http handling logic of which is sensitive on the content type of response [1]. But current jumpgate logic for the api doesn't return any content by http body [2] but with 'application/json' content type [3]. Then it broken that new glanceclient logic and trigger error: "Multiple image matches found for '', use an ID to be more specific.". [0] https://github.com/openstack/python-glanceclient/commit/dbb242b776908ca50ed8557ebfe7cfcd879366c8 [1] https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/http.py#L218 [2] https://github.com/softlayer/jumpgate/blob/master/jumpgate/image/drivers/sl/images.py#L223 [3] https://github.com/racker/falcon/blob/master/falcon/__init__.py#L27 Signed-off-by: Zhi Yan Liu --- jumpgate/image/drivers/sl/images.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jumpgate/image/drivers/sl/images.py b/jumpgate/image/drivers/sl/images.py index 301ffa6..fbd146b 100644 --- a/jumpgate/image/drivers/sl/images.py +++ b/jumpgate/image/drivers/sl/images.py @@ -221,6 +221,7 @@ def on_head(self, req, resp, image_guid, tenant_id=None): } resp.set_headers(headers) + resp.content_type = 'text/html; charset=utf-8' class ImagesV1(ImagesV2):