resource.header with no alias causes AttributeError

Bug #1428342 reported by Brian Curtin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack SDK
Fix Released
Critical
Brian Curtin

Bug Description

When a resource.header has no alias and its original name is not found, we raise a KeyError on the original name, and then we go try to look up the alias name. Since resource.header is looking into requests' CaseInsensitiveDict, alias=None and it tries to call lower() on None, causing an AttributeError. We currently only expect KeyError on that alias lookup, so this blows up.

We will always have a name, but not always an alias. If we catch AttributeError as well, we'll be safe.

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

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

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

Reviewed: https://review.openstack.org/161438
Committed: https://git.openstack.org/cgit/stackforge/python-openstacksdk/commit/?id=ea01e73948b20a49e452c11c3f4a628631df1dd9
Submitter: Jenkins
Branch: master

commit ea01e73948b20a49e452c11c3f4a628631df1dd9
Author: Brian Curtin <email address hidden>
Date: Wed Mar 4 15:57:49 2015 -0600

    Catch AttributeError in header with no alias

    Now that resource.header is a thing and it's populated with the headers
    from a requests.Response, which is a
    requests.structures.CaseInsensitiveDict, we have to take an extra step
    to make sure we don't try and convert a None-alias to lower case.

    Change-Id: I47704191d1822d468389986c5ab203781af59074
    Closes-Bug: 1428342

Changed in python-openstacksdk:
status: In Progress → Fix Committed
Terry Howe (thowe-g)
Changed in python-openstacksdk:
status: Fix Committed → Fix Released
milestone: none → halfliberty
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.