]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Validate outermost request body element name consistently
authorAbhijeet Malawade <Abhijeet.Malawade@nttdata.com>
Fri, 22 May 2015 12:43:25 +0000 (05:43 -0700)
committerAbhijeet Malawade <Abhijeet.Malawade@nttdata.com>
Fri, 19 Jun 2015 06:16:48 +0000 (23:16 -0700)
commit7d203027c7e32283d6d7bf1ca38d10184f4a391f
treec957098c56e9eca5503c8020d1fc0d9e73d97774
parentf51ba4520879414a5ad6169be2723dc20b36b4bb
Validate outermost request body element name consistently

1. Return useful error message instead of empty error message.
ex.- Return "Missing required element '<element name>' in request body"
     instead of "Bad Request"
2. Return consistent error message in case request body element
name is not present.
3. Added 'assert_valid_body' method to raise HTTPBadRequest exception
if request body is not valid. It is not possible to modify
'is_valid_body' method itself to raise exception because V1 and v2
api's return different error code when 'is_valid_body' returns False.

APIImpact

Closes-bug: #1461402
Change-Id: I81764cd8517484fbee4beae2b30668c8b180d677
22 files changed:
cinder/api/contrib/backups.py
cinder/api/contrib/cgsnapshots.py
cinder/api/contrib/consistencygroups.py
cinder/api/contrib/qos_specs_manage.py
cinder/api/contrib/quotas.py
cinder/api/contrib/services.py
cinder/api/contrib/types_extra_specs.py
cinder/api/contrib/types_manage.py
cinder/api/contrib/volume_manage.py
cinder/api/contrib/volume_transfer.py
cinder/api/contrib/volume_type_access.py
cinder/api/contrib/volume_type_encryption.py
cinder/api/openstack/wsgi.py
cinder/api/v2/snapshot_metadata.py
cinder/api/v2/snapshots.py
cinder/api/v2/volume_metadata.py
cinder/api/v2/volumes.py
cinder/tests/unit/api/contrib/test_backups.py
cinder/tests/unit/api/contrib/test_cgsnapshots.py
cinder/tests/unit/api/contrib/test_consistencygroups.py
cinder/tests/unit/api/contrib/test_volume_transfer.py
cinder/tests/unit/api/contrib/test_volume_type_encryption.py