Handle 300 multiple choices response

Bug #1046607 reported by Brian Waldon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
High
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://192.168.27.100:9292/v1/images/detail?limit=20

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": "http://192.168.27.100:9292/v2/", "rel": "self"}]}]}

'images'

Changed in python-glanceclient:
assignee: nobody → Iccha Sethi (iccha-sethi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Changed in python-glanceclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

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)
Changed in python-glanceclient:
milestone: none → v0.5.1
Brian Waldon (bcwaldon)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.