nova/nova/hacking
James Carey 298b0328d2 Remove use of str on exceptions
An exception's message can be a translatable message.  If it is, the message
can contain unicode characters which will cause str to fail.

In cases where the message is explicity needed, the use of str is replaced
with the use of six.text_type.  When an exception is used as a replacement
string in a format string, the logger correctly handles it without the
need for str, so it is removed.

In addition to the case where a translatable message contains unicode,
enabling lazy translation in the oslo.i18n library causes translatable
messages to be replaced with an object that does not support str, this
causes all calls to str on a translatable message to fail.  Thus this patch
is also needed to support blueprint: i18n-enablement.

This patch includes a hacking check for use of str() on exceptions identified
in except statements.

Change-Id: Idb426d7f710ea69b835f70d0e883e93e9b9111d2
Partially-Implements: blueprint i18n-enablement
2014-08-27 13:55:34 +01:00
..
__init__.py Switch to flake8+hacking. 2013-05-17 12:54:12 -07:00
checks.py Remove use of str on exceptions 2014-08-27 13:55:34 +01:00