]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix handling of serialized data in filtering of volumes
authorValeriy Ponomaryov <vponomaryov@mirantis.com>
Tue, 30 Dec 2014 15:51:31 +0000 (17:51 +0200)
committerValeriy Ponomaryov <vponomaryov@mirantis.com>
Tue, 30 Dec 2014 17:36:53 +0000 (19:36 +0200)
commitf39eeebf6eca2745b83a79d2a0def57a126846e7
treed8f0a93e1a45953525ce7e4642ce15a2b67c6acd
parent68613e255b5c96bdc50e4b333600d009e09000ae
Fix handling of serialized data in filtering of volumes

Commit 4aaf40ba1aab4d7c347b05750d0fe21f8d1bcc68 has introduced a bug.
'ast.literal_eval(v)' throws exception 'SyntaxError' if 'v' is an expression
such as UUID '920da701-93c1-4178-9f1a-ef1c7a8a384d', 'd-', or 'd+'.
Catch the 'SyntaxError' exception in addition to 'ValueError' and
assume 'v' is a string. So the API can handle the request successfully
rather than returning a '500' error code.

Change-Id: Ib50cf3be41ae96ed1f9ef0463ced71443e59061c
Closes-Bug: #1406504
cinder/api/v1/volumes.py
cinder/api/v2/volumes.py
cinder/tests/api/v1/test_volumes.py
cinder/tests/api/v2/test_volumes.py