diff --git a/neutron/hacking/checks.py b/neutron/hacking/checks.py index afd9a690bef..3630c6a08ce 100644 --- a/neutron/hacking/checks.py +++ b/neutron/hacking/checks.py @@ -78,7 +78,7 @@ def _directory_to_check_translation(filename): #"neutron/plugins/brocade", "neutron/plugins/cisco", "neutron/plugins/common", - #"neutron/plugins/embrane", + "neutron/plugins/embrane", "neutron/plugins/hyperv", #"neutron/plugins/ibm", "neutron/plugins/linuxbridge", diff --git a/neutron/plugins/embrane/agent/dispatcher.py b/neutron/plugins/embrane/agent/dispatcher.py index 31c5602dc46..9af511f7953 100644 --- a/neutron/plugins/embrane/agent/dispatcher.py +++ b/neutron/plugins/embrane/agent/dispatcher.py @@ -18,6 +18,7 @@ from eventlet import queue from heleosapi import constants as h_con from heleosapi import exceptions as h_exc +from neutron.i18n import _LE from neutron.openstack.common import log as logging from neutron.plugins.embrane.agent.operations import router_operations from neutron.plugins.embrane.common import constants as p_con @@ -127,4 +128,4 @@ class Dispatcher(object): operation_context.item, transient_state) except Exception: - LOG.exception(_("Unhandled exception occurred")) + LOG.exception(_LE("Unhandled exception occurred")) diff --git a/neutron/plugins/embrane/agent/operations/router_operations.py b/neutron/plugins/embrane/agent/operations/router_operations.py index 61059772a27..c5cdcbbb9c7 100644 --- a/neutron/plugins/embrane/agent/operations/router_operations.py +++ b/neutron/plugins/embrane/agent/operations/router_operations.py @@ -17,6 +17,7 @@ import functools from heleosapi import exceptions as h_exc +from neutron.i18n import _LW from neutron.openstack.common import log as logging from neutron.plugins.embrane.common import constants as p_con @@ -92,8 +93,8 @@ def _delete_dva(api, tenant_id, neutron_router): try: api.delete_dva(tenant_id, neutron_router["id"]) except h_exc.DvaNotFound: - LOG.warning(_("The router %s had no physical representation," - "likely already deleted"), neutron_router["id"]) + LOG.warning(_LW("The router %s had no physical representation," + "likely already deleted"), neutron_router["id"]) return p_con.Status.DELETED @@ -121,8 +122,8 @@ def _shrink_dva_iface(api, tenant_id, neutron_router, port_id): dva = api.shrink_interface(tenant_id, neutron_router["id"], neutron_router["admin_state_up"], port_id) except h_exc.InterfaceNotFound: - LOG.warning(_("Interface %s not found in the heleos back-end," - "likely already deleted"), port_id) + LOG.warning(_LW("Interface %s not found in the heleos back-end," + "likely already deleted"), port_id) return (p_con.Status.ACTIVE if neutron_router["admin_state_up"] else p_con.Status.READY) except h_exc.PreliminaryOperationsFailed as ex: diff --git a/neutron/plugins/embrane/base_plugin.py b/neutron/plugins/embrane/base_plugin.py index 0dacc0fe779..4aa25ffec19 100644 --- a/neutron/plugins/embrane/base_plugin.py +++ b/neutron/plugins/embrane/base_plugin.py @@ -25,6 +25,7 @@ from neutron.db import extraroute_db from neutron.db import l3_db from neutron.db import models_v2 from neutron.extensions import l3 +from neutron.i18n import _LE from neutron.openstack.common import log as logging from neutron.plugins.embrane.agent import dispatcher from neutron.plugins.embrane.common import config # noqa @@ -102,7 +103,7 @@ class EmbranePlugin(object): try: self._update_db_interfaces_state(context, neutron_router) except Exception: - LOG.exception(_("Unhandled exception occurred")) + LOG.exception(_LE("Unhandled exception occurred")) return self._set_db_router_state(context, neutron_router, state) def _retrieve_prefix_from_port(self, context, neutron_port): @@ -167,12 +168,12 @@ class EmbranePlugin(object): self._esm_api.get_dva(id) except h_exc.DvaNotFound: - LOG.error(_("The following routers have not physical match: %s"), + LOG.error(_LE("The following routers have not physical match: %s"), id) self._set_db_router_state(context, neutron_router, p_con.Status.ERROR) - LOG.debug(_("Requested router: %s"), neutron_router) + LOG.debug("Requested router: %s", neutron_router) return self._make_router_dict(neutron_router, fields) def get_routers(self, context, filters=None, fields=None, sorts=None, @@ -186,7 +187,7 @@ class EmbranePlugin(object): try: self._esm_api.get_dvas(id_list) except h_exc.DvaNotFound: - LOG.error(_("The following routers have not physical match: %s"), + LOG.error(_LE("The following routers have not physical match: %s"), repr(id_list)) error_routers = [] for id in id_list: @@ -224,7 +225,7 @@ class EmbranePlugin(object): d_context=embrane_ctx.DispatcherContext( p_con.Events.DELETE_ROUTER, neutron_router, context, state_change), args=()) - LOG.debug(_("Deleting router=%s"), neutron_router) + LOG.debug("Deleting router=%s", neutron_router) return neutron_router def add_router_interface(self, context, router_id, interface_info): diff --git a/neutron/plugins/embrane/common/utils.py b/neutron/plugins/embrane/common/utils.py index 34c2d5c44a6..8eb4451a6b1 100644 --- a/neutron/plugins/embrane/common/utils.py +++ b/neutron/plugins/embrane/common/utils.py @@ -17,6 +17,7 @@ from heleosapi import info as h_info from neutron.common import constants from neutron.db import models_v2 +from neutron.i18n import _LI from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -40,7 +41,7 @@ def retrieve_ip_allocation_info(context, neutron_port): try: subnet_id = neutron_port["fixed_ips"][0]["subnet_id"] except (KeyError, IndexError): - LOG.info(_("No ip allocation set")) + LOG.info(_LI("No ip allocation set")) return subnet = retrieve_subnet(context, subnet_id) allocated_ip = neutron_port["fixed_ips"][0]["ip_address"]