Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

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

Merged
merged 1 commit into from Aug 14, 2014
Merged

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

merged 1 commit into from Aug 14, 2014

Conversation

zhiyanliu
Copy link
Contributor

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 '<IMAGE_ID>', use an ID to be more specific.".

[0]
openstack/python-glanceclient@dbb242b
[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

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 '<IMAGE_ID>', use an ID to be more specific.".

[0]
openstack/python-glanceclient@dbb242b
[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
Copy link
Contributor

+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.

jimlindeman added a commit that referenced this pull request Aug 14, 2014
…adata-api

Correct content type of response for image metadata getting api (HEAD)
@jimlindeman jimlindeman merged commit fa76111 into softlayer:master Aug 14, 2014
@zhiyanliu zhiyanliu deleted the correct-content-type-image-metadata-api branch August 14, 2014 06:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants