Volume and Snapshot related metadata api's are raising
"TypeError: object of type 'NoneType' has no len()" if incorrect
formatted metadata is passed. The common
'utils.check_metadata_properties' method is not validating the
metadata properly. This TypeError exception raised is converted
into HTTPBadRequest at wsgi layer.
Fixed this issue by raising an 'InvalidVolumeMetadata' exception
if incorrect formatted metadata is passed to these api's giving
400 HTTPBadRequest to the user. There will no defference in terms
of response status code from user's point of view.
Reviewed: https:/ /review. openstack. org/452051 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=4d4ba60f9b2 84044683eeaa4ca 80674a0b7ee6db
Committed: https:/
Submitter: Jenkins
Branch: master
commit 4d4ba60f9b28404 4683eeaa4ca8067 4a0b7ee6db
Author: dineshbhor <email address hidden>
Date: Mon Mar 20 17:00:30 2017 +0530
Fix metadata api's raises TypeError
Volume and Snapshot related metadata api's are raising check_metadata_ properties' method is not validating the
"TypeError: object of type 'NoneType' has no len()" if incorrect
formatted metadata is passed. The common
'utils.
metadata properly. This TypeError exception raised is converted
into HTTPBadRequest at wsgi layer.
Fixed this issue by raising an 'InvalidVolumeM etadata' exception
if incorrect formatted metadata is passed to these api's giving
400 HTTPBadRequest to the user. There will no defference in terms
of response status code from user's point of view.
Closes-Bug: #1674233 db007df973cf872 57924560fbe
Change-Id: Id86bb9d0887ceb