update quota sets API does not handle all fail cases

Bug #1249971 reported by ling-yun on 2013-11-11
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Low
ling-yun
Havana
Low
ling-yun

Bug Description

The update quota sets API should check whether 'quota_set' is in body.

The code to update quota sets does the following:

for key in body['quota_set'].keys():

ling-yun (zengyunling) on 2013-11-11
description: updated
Changed in cinder:
assignee: nobody → ling-yun (zengyunling)

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

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/55849
Committed: http://github.com/openstack/cinder/commit/2ed2f3aff8eee70e02eb995780af292057cfcad4
Submitter: Jenkins
Branch: master

commit 2ed2f3aff8eee70e02eb995780af292057cfcad4
Author: ling-yun <email address hidden>
Date: Mon Nov 11 22:00:03 2013 +0800

    Update quota-set throw 500 error

    The server doesn't check whether the parameter "quota_set" or
    "quota_class_set" is in request
    body.So the 500 error has been thrown.

    We should catch the KeyError and transfer the KeyError to
    400(HTTPBadRequest) instead of 500.

    Change-Id: I01260c77efa50324f3d203888689cdb1e94d2c21
    Closes-Bug: #1249971

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-12-04
Changed in cinder:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Alan Pevec (apevec) on 2014-03-28
Changed in cinder:
importance: Undecided → Low

Reviewed: https://review.openstack.org/64008
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ed41b6804a8eafb710f8faec425e22ebe0b85ca9
Submitter: Jenkins
Branch: stable/havana

commit ed41b6804a8eafb710f8faec425e22ebe0b85ca9
Author: ling-yun <email address hidden>
Date: Mon Nov 11 22:00:03 2013 +0800

    Update quota-set throw 500 error

    The server doesn't check whether the parameter "quota_set" or
    "quota_class_set" is in request
    body.So the 500 error has been thrown.

    We should catch the KeyError and transfer the KeyError to
    400(HTTPBadRequest) instead of 500.

    Closes-Bug: #1249971
    (cherry picked from commit 2ed2f3aff8eee70e02eb995780af292057cfcad4)
    Change-Id: I01260c77efa50324f3d203888689cdb1e94d2c21

Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers