softlayer / jumpgate

A simple library to make more clouds compatible with OpenStack.
http://softlayer.github.io/jumpgate/
MIT License
46 stars 30 forks source link

Correct content type of response for image metadata getting api #150

Closed zhiyanliu closed 9 years ago

zhiyanliu commented 9 years ago

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 zhiyanl@cn.ibm.com

jimlindeman commented 9 years ago

+1 So essentially all we're fixing here is the HEAD rest call for a specific image to just return back a content-type of plain "text/html" so it doesn't trigger the default of "application/json". I see that at http://www.packetizer.com/ws/rest.html, it says this for the HEAD call: HEAD is similar to GET. The significant difference is that the representation is not returned.