]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Create snapshot throws 500 Internal Error
authorhuangtianhua <huangtianhua@huawei.com>
Mon, 18 Nov 2013 08:58:45 +0000 (16:58 +0800)
committerhuangtianhua <huangtianhua@huawei.com>
Mon, 18 Nov 2013 08:58:45 +0000 (16:58 +0800)
commit381e717b4cdebb75f90dc4c62120e8d607f2a98c
tree2da716271fc67c94562e8f3d216fbb77985ff7d9
parent1099f09a2d22389b75377758f89a4f3365e69305
Create snapshot throws 500 Internal Error

The server doesn't check whether the parameter "volume_id" 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: I8a1dde1fd6ed820b39995af434efacc2a27c9604
Closes-Bug: #1252179
cinder/api/v1/snapshots.py
cinder/api/v2/snapshots.py
cinder/tests/api/v1/test_snapshots.py
cinder/tests/api/v2/test_snapshots.py