From 4badcee9f022b605228b49b51a5e338185359359 Mon Sep 17 00:00:00 2001 From: loooosy Date: Tue, 21 Mar 2017 14:47:48 +0800 Subject: [PATCH] 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: I9561513f28952a8710f5d4ea5c4a6a9c544b3e1e --- oslo_cache/_i18n.py | 10 ---------- oslo_cache/backends/mongo.py | 9 ++++----- oslo_cache/core.py | 5 ++--- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/oslo_cache/_i18n.py b/oslo_cache/_i18n.py index 03cbb3d9..8cde06ed 100644 --- a/oslo_cache/_i18n.py +++ b/oslo_cache/_i18n.py @@ -23,13 +23,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='oslo_cache') # 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_cache/backends/mongo.py b/oslo_cache/backends/mongo.py index f66b8f05..1feebb73 100644 --- a/oslo_cache/backends/mongo.py +++ b/oslo_cache/backends/mongo.py @@ -24,7 +24,6 @@ from oslo_utils import timeutils import six from oslo_cache._i18n import _ -from oslo_cache._i18n import _LW from oslo_cache import exception @@ -422,10 +421,10 @@ class MongoApi(object): existing_value = index_data['expireAfterSeconds'] fld_present = 'doc_date' in index_data['key'][0] if fld_present and existing_value > -1 and ttl_seconds < 1: - msg = _LW('TTL index already exists on db collection ' - '<%(c_name)s>, remove index <%(indx_name)s> ' - 'first to make updated mongo_ttl_seconds value ' - 'to be effective') + msg = ('TTL index already exists on db collection ' + '<%(c_name)s>, remove index <%(indx_name)s> ' + 'first to make updated mongo_ttl_seconds value ' + 'to be effective') LOG.warning(msg, {'c_name': coll_name, 'indx_name': indx_name}) diff --git a/oslo_cache/core.py b/oslo_cache/core.py index d0a5a5e3..ad67616b 100644 --- a/oslo_cache/core.py +++ b/oslo_cache/core.py @@ -43,7 +43,6 @@ from oslo_log import log from oslo_utils import importutils from oslo_cache._i18n import _ -from oslo_cache._i18n import _LE from oslo_cache import _opts from oslo_cache import exception @@ -115,8 +114,8 @@ def _build_cache_config(conf): try: (argname, argvalue) = argument.split(':', 1) except ValueError: - msg = _LE('Unable to build cache config-key. Expected format ' - '":". Skipping unknown format: %s') + msg = ('Unable to build cache config-key. Expected format ' + '":". Skipping unknown format: %s') _LOG.error(msg, argument) continue