From 05039c5dbd2b4ecf61dec9c69516d0562b1bd76f Mon Sep 17 00:00:00 2001 From: Xianghui Zeng Date: Wed, 22 Mar 2017 21:22:15 +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: I5bcba7795894c5f4893c02d9cddb78533011ebd9 --- muranopkgcheck/error.py | 6 ++---- muranopkgcheck/i18n.py | 10 ---------- muranopkgcheck/manager.py | 5 ++--- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/muranopkgcheck/error.py b/muranopkgcheck/error.py index d5fa56f..fbb8567 100644 --- a/muranopkgcheck/error.py +++ b/muranopkgcheck/error.py @@ -12,8 +12,6 @@ # License for the specific language governing permissions and limitations # under the License. -from muranopkgcheck.i18n import _LE - errors = dict() @@ -64,7 +62,7 @@ class Report(object): kwargs['filename'] = filename or meta.name return CheckError(code=code, message=message, **kwargs) if code not in self.errors: - raise ValueError(_LE('Error {} was not registered').format(code)) + raise ValueError('Error {} was not registered'.format(code)) return _report @@ -77,7 +75,7 @@ class Register(object): def __getattr__(self, code): code = ':'.join((self.prefix, code)) if self.prefix else code if code in self.errors: - raise ValueError(_LE('Error {} is already registered') + raise ValueError('Error {} is already registered' .format(code)) def _register(**kwargs): diff --git a/muranopkgcheck/i18n.py b/muranopkgcheck/i18n.py index 9b22f94..b121c00 100644 --- a/muranopkgcheck/i18n.py +++ b/muranopkgcheck/i18n.py @@ -21,13 +21,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='muranopkgcheck') # 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/muranopkgcheck/manager.py b/muranopkgcheck/manager.py index e438fc5..f9cf401 100644 --- a/muranopkgcheck/manager.py +++ b/muranopkgcheck/manager.py @@ -23,7 +23,6 @@ import stevedore from muranopkgcheck import error from muranopkgcheck.i18n import _ -from muranopkgcheck.i18n import _LE from muranopkgcheck import log from muranopkgcheck import pkg_loader from muranopkgcheck.validators import VALIDATORS @@ -123,8 +122,8 @@ class Manager(object): @staticmethod def failure_hook(_, ep, err): - LOG.error(_LE('Could not load {plugin}: {error}' - '').format(plugin=ep.name, error=err)) + LOG.error('Could not load {plugin}: {error}' + ''.format(plugin=ep.name, error=err)) raise err def validate(self, validators=None, select=None, ignore=None,