diff --git a/oslo_versionedobjects/_i18n.py b/oslo_versionedobjects/_i18n.py index fa921555..807aeb52 100644 --- a/oslo_versionedobjects/_i18n.py +++ b/oslo_versionedobjects/_i18n.py @@ -23,13 +23,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='oslo_versionedobjects') # The primary translation function using the well-known name "_" _ = _translators.primary - -# Translators for log levels. -# -# The abbreviated names are meant to reflect the usual use of a short -# name like '_'. The "L" is for "log" and the other letter comes from -# the level. -_LI = _translators.log_info -_LW = _translators.log_warning -_LE = _translators.log_error -_LC = _translators.log_critical diff --git a/oslo_versionedobjects/base.py b/oslo_versionedobjects/base.py index 44c431d3..1cfc8d06 100644 --- a/oslo_versionedobjects/base.py +++ b/oslo_versionedobjects/base.py @@ -26,7 +26,7 @@ from oslo_utils import excutils from oslo_utils import versionutils as vutils import six -from oslo_versionedobjects._i18n import _, _LE +from oslo_versionedobjects._i18n import _ from oslo_versionedobjects import exception from oslo_versionedobjects import fields as obj_fields @@ -84,7 +84,7 @@ def _make_class_properties(cls): except Exception: with excutils.save_and_reraise_exception(): attr = "%s.%s" % (self.obj_name(), name) - LOG.exception(_LE('Error setting %(attr)s'), + LOG.exception('Error setting %(attr)s', {'attr': attr}) def deleter(self, name=name): @@ -360,8 +360,8 @@ class VersionedObject(object): def obj_class_from_name(cls, objname, objver): """Returns a class from the registry based on a name and version.""" if objname not in VersionedObjectRegistry.obj_classes(): - LOG.error(_LE('Unable to instantiate unregistered object type ' - '%(objtype)s'), dict(objtype=objname)) + LOG.error('Unable to instantiate unregistered object type ' + '%(objtype)s'), dict(objtype=objname) raise exception.UnsupportedObjectError(objtype=objname) # NOTE(comstud): If there's not an exact match, return the highest diff --git a/oslo_versionedobjects/exception.py b/oslo_versionedobjects/exception.py index df58f8ea..18c2afc7 100644 --- a/oslo_versionedobjects/exception.py +++ b/oslo_versionedobjects/exception.py @@ -31,7 +31,7 @@ from oslo_utils import excutils import six import webob.exc -from oslo_versionedobjects._i18n import _, _LE +from oslo_versionedobjects._i18n import _ LOG = logging.getLogger(__name__) @@ -123,7 +123,7 @@ class VersionedObjectsException(Exception): exc_info = sys.exc_info() # kwargs doesn't match a variable in the message # log the issue and the kwargs - LOG.exception(_LE('Exception in string format operation')) + LOG.exception('Exception in string format operation') for name, value in kwargs.items(): LOG.error("%s: %s" % (name, value)) # noqa