From 535def34473565135c44e7870aab03a4ac1614aa Mon Sep 17 00:00:00 2001 From: yfzhao Date: Tue, 21 Mar 2017 14:40:28 +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. Change-Id: I504de69b2e64250740ebcab432042a16f966fdbe Closes-Bug: #1674584 --- openstackclient/compute/v2/service.py | 5 ++--- openstackclient/i18n.py | 10 ---------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py index 7b18c2e50..b5b9bd5e1 100644 --- a/openstackclient/compute/v2/service.py +++ b/openstackclient/compute/v2/service.py @@ -22,7 +22,6 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.i18n import _ -from openstackclient.i18n import _LE LOG = logging.getLogger(__name__) @@ -189,7 +188,7 @@ class SetService(command.Command): cs.disable(parsed_args.host, parsed_args.service) except Exception: status = "enabled" if enabled else "disabled" - LOG.error(_LE("Failed to set service status to %s"), status) + LOG.error("Failed to set service status to %s", status) result += 1 force_down = None @@ -203,7 +202,7 @@ class SetService(command.Command): force_down=force_down) except Exception: state = "down" if force_down else "up" - LOG.error(_LE("Failed to set service state to %s"), state) + LOG.error("Failed to set service state to %s", state) result += 1 if result > 0: diff --git a/openstackclient/i18n.py b/openstackclient/i18n.py index 1d09772ca..7564c60fb 100644 --- a/openstackclient/i18n.py +++ b/openstackclient/i18n.py @@ -19,13 +19,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='openstackclient') # 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