Remove log translations
Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: Ibfe04fd84dc50d5d4ad6ad6736e6d8b74c8e41b4 Closes-Bug: 1674577
This commit is contained in:
parent
16a6db4e9e
commit
2c9258b4ed
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user