Redirect processing doesn't work

Bug #1231524 reported by Russell Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Russell Bryant

Bug Description

The code for processing an HTTP redirect has the following code:

         elif resp.status in (301, 302, 305):
             # Redirected. Reissue the request to the new location.
             return self._http_request(resp['location'], method, **kwargs)

The problem is the way it tries to get the location header. HTTPResponse doesn't support this. You have to call the getheader() method on the response, instead.

Changed in python-glanceclient:
assignee: nobody → Russell Bryant (russellb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-glanceclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/48480

Changed in python-glanceclient:
status: New → In Progress
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/48481

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/48480
Committed: http://github.com/openstack/python-glanceclient/commit/471863581114a5cabc50392f17033ed04a79f37d
Submitter: Jenkins
Branch: master

commit 471863581114a5cabc50392f17033ed04a79f37d
Author: Russell Bryant <email address hidden>
Date: Thu Sep 26 11:42:16 2013 -0400

    Fix default value for a header

    This code specified None as the default value, but it would raise an
    exception if that was ever returned. An empty string causes the code to
    work as intended.

    This came up while I was writing a unit test for another bug fix.

    Change-Id: I658bb8a9b5124f281988fb60b645182ea0ccf99f
    Related-bug: #1231524

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/48481
Committed: http://github.com/openstack/python-glanceclient/commit/50266eec2b86aaa0a7717adf004576d444f4fce9
Submitter: Jenkins
Branch: master

commit 50266eec2b86aaa0a7717adf004576d444f4fce9
Author: Russell Bryant <email address hidden>
Date: Thu Sep 26 11:43:29 2013 -0400

    Fix getting header in redirect processing

    The code for processing an HTTP redirect included an incorrect method of
    getting the Location header from an HTTPResponse. It needs to use the
    getheader() method on the response, instead. This patch fixes that and
    includes a unit test that covers this code path.

    Change-Id: I0952fabad581b020dee07bdc4007b55b47c906aa
    Closes-Bug: #1231524

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz)
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.