Handle 300 multiple choices response

Bug #1046607 reported by Brian Waldon on 2012-09-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Iccha Sethi

Bug Description

If I make a request to the v1 API (glance image-list) but that version of the API is not available, I get the following (debug) response. The line at the bottom indicates a KeyError is being raised:

vagrant@precise:~/devstack$ glance --debug image-list
curl -i -X GET -H 'X-Auth-Token: 8a41945380af4da98b71163d2d03b554' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient'

HTTP/1.1 300 Multiple Choices
date: Wed, 05 Sep 2012 23:42:08 GMT
content-length: 126
content-type: application/json

{"versions": [{"status": "EXPERIMENTAL", "id": "v2.0", "links": [{"href": "", "rel": "self"}]}]}


Changed in python-glanceclient:
assignee: nobody → Iccha Sethi (iccha-sethi)

Fix proposed to branch: master
Review: https://review.openstack.org/12607

Changed in python-glanceclient:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/12607
Committed: http://github.com/openstack/python-glanceclient/commit/5acd5a6a4adc430989ae05c434d0ac5a9a448b84
Submitter: Jenkins
Branch: master

commit 5acd5a6a4adc430989ae05c434d0ac5a9a448b84
Author: isethi <email address hidden>
Date: Fri Sep 7 20:54:09 2012 +0000

    Catches HTTP 300 while printing responses

    If glance v1 api is not enabled, and a request is made to it,
    it gives a KeyError. This patch catches the 300 error and
    displays error message.

    Fixes bug 1046607

    Change-Id: I0009a5deca3b5dd5ccaeaea90feee21274bfe090

Changed in python-glanceclient:
status: In Progress → Fix Committed
Brian Waldon (bcwaldon) on 2012-09-11
Changed in python-glanceclient:
milestone: none → v0.5.1
Brian Waldon (bcwaldon) on 2012-09-11
Changed in python-glanceclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers