diff --git a/ironic/api/controllers/v1/ramdisk.py b/ironic/api/controllers/v1/ramdisk.py index 921a374927..8a12feca42 100644 --- a/ironic/api/controllers/v1/ramdisk.py +++ b/ironic/api/controllers/v1/ramdisk.py @@ -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}) diff --git a/ironic/api/hooks.py b/ironic/api/hooks.py index 65321de6e8..94e89d98f8 100644 --- a/ironic/api/hooks.py +++ b/ironic/api/hooks.py @@ -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 diff --git a/ironic/api/middleware/auth_token.py b/ironic/api/middleware/auth_token.py index c2aba19fab..1cf1f59819 100644 --- a/ironic/api/middleware/auth_token.py +++ b/ironic/api/middleware/auth_token.py @@ -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) diff --git a/ironic/api/middleware/parsable_error.py b/ironic/api/middleware/parsable_error.py index b0de053029..6e742c0692 100644 --- a/ironic/api/middleware/parsable_error.py +++ b/ironic/api/middleware/parsable_error.py @@ -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) + ''))] except et.ElementTree.ParseError as err: - LOG.error(_LE('Error parsing HTTP response: %s'), err) + LOG.error('Error parsing HTTP response: %s', err) body = ['%s' % state['status_code'] + ''] state['headers'].append(('Content-Type', 'application/xml'))