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:
parent
1a45b227df
commit
c1da585256
@ -153,7 +153,8 @@ class MetadataRequestHandler(wsgi.Application):
|
|||||||
remote_address)
|
remote_address)
|
||||||
msg = _('An unknown error has occurred. '
|
msg = _('An unknown error has occurred. '
|
||||||
'Please try your request again.')
|
'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:
|
if meta_data is None:
|
||||||
LOG.error(_LE('Failed to get metadata for ip: %s'),
|
LOG.error(_LE('Failed to get metadata for ip: %s'),
|
||||||
@ -210,7 +211,8 @@ class MetadataRequestHandler(wsgi.Application):
|
|||||||
instance_id)
|
instance_id)
|
||||||
msg = _('An unknown error has occurred. '
|
msg = _('An unknown error has occurred. '
|
||||||
'Please try your request again.')
|
'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:
|
if meta_data is None:
|
||||||
LOG.error(_LE('Failed to get metadata for instance id: %s'),
|
LOG.error(_LE('Failed to get metadata for instance id: %s'),
|
||||||
|
Loading…
Reference in New Issue
Block a user