From bd20b2dbbf68ccb77903bfbf3c5fdda733b48a5f Mon Sep 17 00:00:00 2001 From: luqitao Date: Tue, 21 Mar 2017 02:13:13 -0400 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: I2b70b72ac633c559e7ad366d6a1c1763aebf562a --- muranoclient/common/http.py | 5 ++--- muranoclient/common/utils.py | 5 ++--- muranoclient/i18n.py | 10 ---------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/muranoclient/common/http.py b/muranoclient/common/http.py index b96bd4a9..7431e949 100644 --- a/muranoclient/common/http.py +++ b/muranoclient/common/http.py @@ -27,7 +27,6 @@ import six from six.moves import urllib from muranoclient.common import exceptions as exc -from muranoclient.i18n import _LW LOG = logging.getLogger(__name__) USER_AGENT = 'python-muranoclient' @@ -49,7 +48,7 @@ def get_system_ca_file(): if os.path.exists(ca): LOG.debug("Using ca file %s", ca) return ca - LOG.warning(_LW("System ca file could not be found.")) + LOG.warning("System ca file could not be found.") class HTTPClient(object): @@ -371,5 +370,5 @@ def _set_data(kwargs): if 'data' in kwargs: raise ValueError("Can't provide both 'data' and " "'body' to a request") - LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead")) + LOG.warning("Use of 'body' is deprecated; use 'data' instead") kwargs['data'] = kwargs.pop('body') diff --git a/muranoclient/common/utils.py b/muranoclient/common/utils.py index 34abde6c..e19f833d 100644 --- a/muranoclient/common/utils.py +++ b/muranoclient/common/utils.py @@ -43,7 +43,6 @@ import yaql from muranoclient.common import exceptions from muranoclient.i18n import _ -from muranoclient.i18n import _LW try: import yaql.language # noqa @@ -586,8 +585,8 @@ def ensure_images(glance_client, image_specs, base_url, def _image_valid(image, keys): for key in keys: if key not in image: - LOG.warning(_LW("Image specification invalid: " - "No {0} key in image ").format(key)) + LOG.warning("Image specification invalid: " + "No {0} key in image ").format(key) return False return True diff --git a/muranoclient/i18n.py b/muranoclient/i18n.py index 198d66e9..c02ff78c 100644 --- a/muranoclient/i18n.py +++ b/muranoclient/i18n.py @@ -22,13 +22,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='muranoclient') # 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