Use six.text_type instead of unicode

According to 6683905b53 ,
we shouldn't use unicode in an exception message.

Change-Id: I377f0cf7b8a66026491b75e89b470a328670f17a
This commit is contained in:
Eli Qiao 2014-11-06 14:58:23 +08:00
parent 1a45b227df
commit c1da585256

View File

@ -153,7 +153,8 @@ class MetadataRequestHandler(wsgi.Application):
remote_address)
msg = _('An unknown error has occurred. '
'Please try your request again.')
raise webob.exc.HTTPInternalServerError(explanation=unicode(msg))
raise webob.exc.HTTPInternalServerError(
explanation=six.text_type(msg))
if meta_data is None:
LOG.error(_LE('Failed to get metadata for ip: %s'),
@ -210,7 +211,8 @@ class MetadataRequestHandler(wsgi.Application):
instance_id)
msg = _('An unknown error has occurred. '
'Please try your request again.')
raise webob.exc.HTTPInternalServerError(explanation=unicode(msg))
raise webob.exc.HTTPInternalServerError(
explanation=six.text_type(msg))
if meta_data is None:
LOG.error(_LE('Failed to get metadata for instance id: %s'),