Raise KeyError exception while generating a WSGI response based on the exception

Bug #1259867 reported by huangtianhua on 2013-12-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
huangtianhua

Bug Description

1. Create snapshot metadata with a too long key('a'*260)

    On the _update_snapshot_metadata() in snapshot_metadata.py, it will raise HTTPRequestEntityTooLarge(413) exception in this case. So the 413 exception expected to raise. But we got the server fault(500)

2. The KeyError exception raised while generating a WSGI response based on the exception, because headers no 'Retry-After' attribute in this case.

   if code == 413:
            retry = self.wrapped_exc.headers['Retry-After']
            fault_data[fault_name]['retryAfter'] = retry

Changed in cinder:
assignee: nobody → huangtianhua (huangtianhua)

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

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/61356
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=92e058d6800e1cb33a0359cdc5c079b55612525c
Submitter: Jenkins
Branch: master

commit 92e058d6800e1cb33a0359cdc5c079b55612525c
Author: huangtianhua <email address hidden>
Date: Wed Dec 11 17:35:13 2013 +0800

    Fix KeyError while generating a WSGI response

    The KeyError exception raised while generating a WSGI response based on
    the 413 exception. Because there may be no "Retry-After" attribute in the
    exception headers.

    Change-Id: I89eb1878acc2195775be17fbcba8088f2e00bac1
    Closes-Bug: #1259867

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-01-22
Changed in cinder:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers