Merge "Remove log translations"
This commit is contained in:
@@ -30,16 +30,6 @@ _C = _translators.contextual_form
|
|||||||
# requires oslo.i18n >=2.1.0
|
# requires oslo.i18n >=2.1.0
|
||||||
_P = _translators.plural_form
|
_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():
|
def get_available_languages():
|
||||||
return oslo_i18n.get_available_languages(DOMAIN)
|
return oslo_i18n.get_available_languages(DOMAIN)
|
||||||
|
@@ -18,7 +18,7 @@ import re
|
|||||||
|
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
|
|
||||||
from watcherclient._i18n import _, _LW
|
from watcherclient._i18n import _
|
||||||
from watcherclient import exceptions
|
from watcherclient import exceptions
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
@@ -202,8 +202,8 @@ def get_api_version(version_string):
|
|||||||
version_string = str(version_string)
|
version_string = str(version_string)
|
||||||
if version_string in DEPRECATED_VERSIONS:
|
if version_string in DEPRECATED_VERSIONS:
|
||||||
LOG.warning(
|
LOG.warning(
|
||||||
_LW("Version %(deprecated_version)s is deprecated, using "
|
"Version %(deprecated_version)s is deprecated, using "
|
||||||
"alternative version %(alternative)s instead."),
|
"alternative version %(alternative)s instead.",
|
||||||
{"deprecated_version": version_string,
|
{"deprecated_version": version_string,
|
||||||
"alternative": DEPRECATED_VERSIONS[version_string]})
|
"alternative": DEPRECATED_VERSIONS[version_string]})
|
||||||
version_string = DEPRECATED_VERSIONS[version_string]
|
version_string = DEPRECATED_VERSIONS[version_string]
|
||||||
|
@@ -33,7 +33,7 @@ import six
|
|||||||
from six.moves import http_client
|
from six.moves import http_client
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from watcherclient._i18n import _, _LE, _LW
|
from watcherclient._i18n import _
|
||||||
from watcherclient import exceptions
|
from watcherclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
@@ -185,8 +185,8 @@ def with_retries(func):
|
|||||||
try:
|
try:
|
||||||
return func(self, url, method, **kwargs)
|
return func(self, url, method, **kwargs)
|
||||||
except _RETRY_EXCEPTIONS as error:
|
except _RETRY_EXCEPTIONS as error:
|
||||||
msg = (_LE("Error contacting Watcher server: %(error)s. "
|
msg = ("Error contacting Watcher server: %(error)s. "
|
||||||
"Attempt %(attempt)d of %(total)d") %
|
"Attempt %(attempt)d of %(total)d" %
|
||||||
{'attempt': attempt,
|
{'attempt': attempt,
|
||||||
'total': num_attempts,
|
'total': num_attempts,
|
||||||
'error': error})
|
'error': error})
|
||||||
@@ -397,7 +397,7 @@ class HTTPClient(VersionNegotiationMixin):
|
|||||||
try:
|
try:
|
||||||
body = jsonutils.loads(body)
|
body = jsonutils.loads(body)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
LOG.error(_LE('Could not decode response body as JSON'))
|
LOG.error('Could not decode response body as JSON')
|
||||||
else:
|
else:
|
||||||
body = None
|
body = None
|
||||||
|
|
||||||
@@ -558,7 +558,7 @@ class SessionClient(VersionNegotiationMixin, adapter.LegacyJsonAdapter):
|
|||||||
try:
|
try:
|
||||||
body = resp.json()
|
body = resp.json()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
LOG.error(_LE('Could not decode response body as JSON'))
|
LOG.error('Could not decode response body as JSON')
|
||||||
else:
|
else:
|
||||||
body = None
|
body = None
|
||||||
|
|
||||||
@@ -602,8 +602,8 @@ def _construct_http_client(endpoint=None,
|
|||||||
dvars = [k for k, v in ignored.items() if v]
|
dvars = [k for k, v in ignored.items() if v]
|
||||||
|
|
||||||
if dvars:
|
if dvars:
|
||||||
LOG.warning(_LW('The following arguments are ignored when using '
|
LOG.warning('The following arguments are ignored when using '
|
||||||
'the session to construct a client: %s'),
|
'the session to construct a client: %s',
|
||||||
', '.join(dvars))
|
', '.join(dvars))
|
||||||
|
|
||||||
return SessionClient(session=session,
|
return SessionClient(session=session,
|
||||||
@@ -615,8 +615,8 @@ def _construct_http_client(endpoint=None,
|
|||||||
**kwargs)
|
**kwargs)
|
||||||
else:
|
else:
|
||||||
if kwargs:
|
if kwargs:
|
||||||
LOG.warning(_LW('The following arguments are being ignored when '
|
LOG.warning('The following arguments are being ignored when '
|
||||||
'constructing the client: %s'), ', '.join(kwargs))
|
'constructing the client: %s', ', '.join(kwargs))
|
||||||
|
|
||||||
return HTTPClient(endpoint=endpoint,
|
return HTTPClient(endpoint=endpoint,
|
||||||
token=token,
|
token=token,
|
||||||
|
Reference in New Issue
Block a user