]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Don't send untextified exc to webob
authorJay S. Bryant <jsbryant@us.ibm.com>
Wed, 12 Mar 2014 22:39:18 +0000 (17:39 -0500)
committerJay S. Bryant <jsbryant@us.ibm.com>
Thu, 13 Mar 2014 17:36:02 +0000 (12:36 -0500)
commit5757c857bdf526dc82cc8c1d4200d92c183e9374
tree7c77f7e53a850a99ffd0e3a297510e420a7d9a9c
parenteaf1b7998ffe0b37ce77e540dd29a810a2d4d003
Don't send untextified exc to webob

As part of commit cbe1d5f5e22e5f792128643e4cdd6afb2ff2b5bf I
accidentally removed the str() from exceptions that were being
passed out of OpenStack to webob.  This broke the contract with
webob which was expecting strings (text) to be sent.  This
resulted in webob doing bad things if we encountered an exception,
like trying to create a duplicate volume type.

This commit replaces the str()'s that shouldn't have been removed
with six.text_type() which should be used in place of str() to
resolve this issue.  There was one instance where a message was
instead being unicoded, this also was changed to use six.text_type.

This commit also fixes one message that should have been translated
but was not.

Change-Id: Iad6a81108f58c1bfd13397479022c4c4ad1ccc56
Closes-bug: 1290715
cinder/api/contrib/qos_specs_manage.py
cinder/api/contrib/types_manage.py
cinder/tests/api/contrib/test_types_manage.py