Remove translation of log messages from ironic/api

The i18n team has decided not to translate the logs because it seems
like it's not very useful.

This patch removes translation of log messages from ironic/api.

Change-Id: Icddd5918f9c9b6d80d4e9b1cbbae13ecebd52988
Partial-Bug: #1674374
This commit is contained in:
Joanna Taryma 2017-04-05 09:53:58 -07:00
parent a8abc54c1b
commit 474d0909db
4 changed files with 12 additions and 16 deletions

View File

@ -25,7 +25,6 @@ from ironic.api.controllers.v1 import types
from ironic.api.controllers.v1 import utils as api_utils
from ironic.api import expose
from ironic.common import exception
from ironic.common.i18n import _LW
from ironic.common import policy
from ironic.common import states
from ironic.common import utils
@ -119,10 +118,10 @@ class LookupController(rest.RestController):
if invalid_addresses:
node_log = ('' if not node_uuid
else _LW('(Node UUID: %s)') % node_uuid)
LOG.warning(_LW('The following MAC addresses "%(addrs)s" are '
'invalid and will be ignored by the lookup '
'request %(node)s'),
else '(Node UUID: %s)' % node_uuid)
LOG.warning('The following MAC addresses "%(addrs)s" are '
'invalid and will be ignored by the lookup '
'request %(node)s',
{'addrs': ', '.join(invalid_addresses),
'node': node_log})

View File

@ -23,7 +23,6 @@ import six
from six.moves import http_client
from ironic.common import context
from ironic.common.i18n import _LW
from ironic.common import policy
from ironic.conductor import rpcapi
from ironic.db import api as dbapi
@ -48,19 +47,19 @@ def policy_deprecation_check():
str_rule = six.text_type(rule)
for deprecated, replacement in substitution_dict.items():
if re.search(r'\b%s\b' % deprecated, str_rule):
LOG.warning(_LW(
LOG.warning(
"Deprecated argument %(deprecated)s is used in policy "
"file rule (%(rule)s), please use %(replacement)s "
"argument instead. The possibility to use deprecated "
"arguments will be removed in the Pike release."),
"arguments will be removed in the Pike release.",
{'deprecated': deprecated, 'replacement': replacement,
'rule': str_rule})
if deprecated == 'domain_name':
LOG.warning(_LW(
LOG.warning(
"Please note that user_domain_id is an ID of the "
"user domain, while the deprecated domain_name is "
"its name. The policy rule has to be updated "
"accordingly."))
"accordingly.")
CHECKED_DEPRECATED_POLICY_ARGS = True

View File

@ -42,10 +42,8 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)
for route_tpl in api_routes]
except re.error as e:
msg = _('Cannot compile public API routes: %s') % e
LOG.error(msg)
raise exception.ConfigInvalid(error_msg=msg)
raise exception.ConfigInvalid(
error_msg=_('Cannot compile public API routes: %s') % e)
super(AuthTokenMiddleware, self).__init__(app, conf)

View File

@ -27,7 +27,7 @@ from oslo_log import log
import six
import webob
from ironic.common.i18n import _, _LE
from ironic.common.i18n import _
LOG = log.getLogger(__name__)
@ -76,7 +76,7 @@ class ParsableErrorMiddleware(object):
+ '\n'.join(app_iter)
+ '</error_message>'))]
except et.ElementTree.ParseError as err:
LOG.error(_LE('Error parsing HTTP response: %s'), err)
LOG.error('Error parsing HTTP response: %s', err)
body = ['<error_message>%s' % state['status_code']
+ '</error_message>']
state['headers'].append(('Content-Type', 'application/xml'))