Merge "Remove log translations"

This commit is contained in:
Jenkins 2017-03-29 12:57:12 +00:00 committed by Gerrit Code Review
commit 07b19ede3f
3 changed files with 12 additions and 22 deletions

View File

@ -30,16 +30,6 @@ _C = _translators.contextual_form
# requires oslo.i18n >=2.1.0
_P = _translators.plural_form
# 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
def get_available_languages():
return oslo_i18n.get_available_languages(DOMAIN)

View File

@ -18,7 +18,7 @@ import re
from oslo_utils import strutils
from watcherclient._i18n import _, _LW
from watcherclient._i18n import _
from watcherclient import exceptions
LOG = logging.getLogger(__name__)
@ -202,8 +202,8 @@ def get_api_version(version_string):
version_string = str(version_string)
if version_string in DEPRECATED_VERSIONS:
LOG.warning(
_LW("Version %(deprecated_version)s is deprecated, using "
"alternative version %(alternative)s instead."),
"Version %(deprecated_version)s is deprecated, using "
"alternative version %(alternative)s instead.",
{"deprecated_version": version_string,
"alternative": DEPRECATED_VERSIONS[version_string]})
version_string = DEPRECATED_VERSIONS[version_string]

View File

@ -33,7 +33,7 @@ import six
from six.moves import http_client
import six.moves.urllib.parse as urlparse
from watcherclient._i18n import _, _LE, _LW
from watcherclient._i18n import _
from watcherclient import exceptions
@ -185,8 +185,8 @@ def with_retries(func):
try:
return func(self, url, method, **kwargs)
except _RETRY_EXCEPTIONS as error:
msg = (_LE("Error contacting Watcher server: %(error)s. "
"Attempt %(attempt)d of %(total)d") %
msg = ("Error contacting Watcher server: %(error)s. "
"Attempt %(attempt)d of %(total)d" %
{'attempt': attempt,
'total': num_attempts,
'error': error})
@ -397,7 +397,7 @@ class HTTPClient(VersionNegotiationMixin):
try:
body = jsonutils.loads(body)
except ValueError:
LOG.error(_LE('Could not decode response body as JSON'))
LOG.error('Could not decode response body as JSON')
else:
body = None
@ -558,7 +558,7 @@ class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
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')
else:
body = None
@ -602,8 +602,8 @@ def _construct_http_client(endpoint=None,
dvars = [k for k, v in ignored.items() if v]
if dvars:
LOG.warning(_LW('The following arguments are ignored when using '
'the session to construct a client: %s'),
LOG.warning('The following arguments are ignored when using '
'the session to construct a client: %s',
', '.join(dvars))
return SessionClient(session=session,
@ -615,8 +615,8 @@ def _construct_http_client(endpoint=None,
**kwargs)
else:
if kwargs:
LOG.warning(_LW('The following arguments are being ignored when '
'constructing the client: %s'), ', '.join(kwargs))
LOG.warning('The following arguments are being ignored when '
'constructing the client: %s', ', '.join(kwargs))
return HTTPClient(endpoint=endpoint,
token=token,