Merge "remove six in venus/api/middleware/fault.py"

This commit is contained in:
Zuul 2020-12-23 01:42:56 +00:00 committed by Gerrit Code Review
commit 53990ad4e2

View File

@ -13,7 +13,6 @@
# under the License. # under the License.
from oslo_log import log as logging from oslo_log import log as logging
import six
import webob.dec import webob.dec
import webob.exc import webob.exc
@ -61,7 +60,7 @@ class FaultWrapper(base_wsgi.Middleware):
# including those that are safe to expose, see bug 1021373 # including those that are safe to expose, see bug 1021373
if safe: if safe:
msg = (inner.msg if isinstance(inner, exception.VenusException) msg = (inner.msg if isinstance(inner, exception.VenusException)
else six.text_type(inner)) else str(inner))
params = {'exception': inner.__class__.__name__, params = {'exception': inner.__class__.__name__,
'explanation': msg} 'explanation': msg}
outer.explanation = _('%(exception)s: %(explanation)s') % params outer.explanation = _('%(exception)s: %(explanation)s') % params