Replace oslo_utils.encodeutils.exception_to_unicode (again)
The function is deprecated because it is equivalent to str(ex) in
Python 3.
Fix a few remaining usages which were overlooked by the previous
attempt[1].
[1] 8331446fa4
Change-Id: I8915500f49f3bd13b848da2709658da533d14cfe
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -17,7 +17,6 @@ import os
|
||||
import re
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import encodeutils
|
||||
import sqlalchemy
|
||||
from sqlalchemy import event
|
||||
from sqlalchemy import exc
|
||||
@@ -210,11 +209,9 @@ class BaseMySqlAdmin(object, metaclass=abc.ABCMeta):
|
||||
user.check_reserved()
|
||||
except ValueError as ve:
|
||||
LOG.exception("Error Getting user information")
|
||||
err_msg = encodeutils.exception_to_unicode(ve)
|
||||
raise exception.BadRequest(_("Username %(user)s is not valid"
|
||||
": %(reason)s") %
|
||||
{'user': username, 'reason': err_msg}
|
||||
)
|
||||
raise exception.BadRequest(
|
||||
_("Username %(user)s is not valid: %(reason)s") %
|
||||
{'user': username, 'reason': ve})
|
||||
with mysql_util.SqlClient(
|
||||
self.mysql_app.get_engine(), use_flush=True) as client:
|
||||
q = sql_query.Query()
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import encodeutils
|
||||
import stevedore
|
||||
|
||||
from trove.common import base_exception as exception
|
||||
@@ -71,8 +70,7 @@ class ModuleDriverManager(object):
|
||||
LOG.info("Driver '%s' not supported, skipping",
|
||||
driver.get_type())
|
||||
except AttributeError as ex:
|
||||
LOG.exception("Exception loading module driver: %s",
|
||||
encodeutils.exception_to_unicode(ex))
|
||||
LOG.exception("Exception loading module driver: %s", ex)
|
||||
|
||||
return supported
|
||||
|
||||
|
||||
Reference in New Issue
Block a user