]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Evaluate lazy translation in exception __str__
authorLiang Chen <cbjchen@cn.ibm.com>
Thu, 8 Aug 2013 10:11:48 +0000 (18:11 +0800)
committerLiang Chen <cbjchen@cn.ibm.com>
Fri, 23 Aug 2013 15:02:06 +0000 (23:02 +0800)
commita67f85267acee85c2073373ce1206ec3d174f930
treee20044a21fa4bb640791f7420c2f61b90461f5cc
parent1c20d351b1c0765f300e1578abc1fd9af6a6a036
Evaluate lazy translation in exception __str__

The OpenStackException.__str__ method returns
self._error_string which is actually a gettextutil.Message
object not a str.

str(o) will check the return type of o.__str__() and raise
TypeError if __str__ returns non-string object.

The fix will not go into oslo as OpenStackException is
about to be deprecated. And this patch is also the first
step to remove all the references to oslo exception.py.

Fixes bug #1208454

Change-Id: Ib6abe3517bcb1b34fc6a71e5c46ee3774e067f9a
heat/api/middleware/fault.py
heat/common/exception.py
heat/engine/dependencies.py
heat/engine/resources/rackspace/cloud_loadbalancer.py
heat/tests/test_exception.py [new file with mode: 0644]