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: I7fa054469bef233c31d0661bb40af226562e673e
This commit is contained in:
daohanli 2017-03-22 00:00:19 +08:00
parent a9d817fd05
commit f29cdbdd2a
3 changed files with 3 additions and 16 deletions

View File

@ -29,7 +29,6 @@ from six.moves.urllib import parse
from pankoclient.common import exceptions as exc
from pankoclient.common.i18n import _
from pankoclient.common.i18n import _LW
from pankoclient.common import utils
LOG = logging.getLogger(__name__)
@ -55,7 +54,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):

View File

@ -19,13 +19,3 @@ _translators = oslo_i18n.TranslatorFactory(domain='pankoclient')
# 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

View File

@ -16,8 +16,6 @@ from six.moves.urllib import parse as urllib_parse
import logging
from pankoclient.common.i18n import _LE
LOG = logging.getLogger(__name__)
@ -28,12 +26,12 @@ def get_response_body(resp):
try:
body = resp.json()
except ValueError:
LOG.error(_LE('Could not decode response body as JSON'))
LOG.error('Could not decode response body as JSON')
elif 'application/octet-stream' in content_type:
try:
body = resp.body()
except ValueError:
LOG.error(_LE('Could not decode response body as raw'))
LOG.error('Could not decode response body as raw')
else:
body = None
return body