From: Akihiro Motoki Date: Mon, 1 Sep 2014 13:24:54 +0000 (+0900) Subject: Fix a bug in Mellanox plugin RPC caused by secgroup RPC refactoring X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d3ed330ca81d9663b1280a0386b572421ec48496;p=openstack-build%2Fneutron-build.git Fix a bug in Mellanox plugin RPC caused by secgroup RPC refactoring SecurityGroupsRpcCallback RPC refactoring patch (commit 2781fce238) moves get_port_from_device method from plugin RPC callback class to plugin layer, but Mellanox plugin RPC callback was forgot to update and as a result RPC calls from agents to Mellanox plugin fails. Change-Id: I1aa82ac00c16a53a59a93087f0ca4ef281ee3f2b Related-Bug: #1359416 --- diff --git a/neutron/plugins/mlnx/rpc_callbacks.py b/neutron/plugins/mlnx/rpc_callbacks.py index d2252d350..2acfb4350 100644 --- a/neutron/plugins/mlnx/rpc_callbacks.py +++ b/neutron/plugins/mlnx/rpc_callbacks.py @@ -17,6 +17,7 @@ from oslo.config import cfg from neutron.common import constants as q_const from neutron.common import rpc as n_rpc from neutron.db import api as db_api +from neutron import manager from neutron.openstack.common import log as logging from neutron.plugins.mlnx.db import mlnx_db_v2 as db @@ -35,7 +36,8 @@ class MlnxRpcCallbacks(n_rpc.RpcCallback): device = kwargs.get('device') LOG.debug(_("Device %(device)s details requested from %(agent_id)s"), {'device': device, 'agent_id': agent_id}) - port = self.get_port_from_device(device) + plugin = manager.NeutronManager.get_plugin() + port = plugin.get_port_from_device(device) if port: binding = db.get_network_binding(db_api.get_session(), port['network_id']) @@ -74,7 +76,8 @@ class MlnxRpcCallbacks(n_rpc.RpcCallback): device = kwargs.get('device') LOG.debug(_("Device %(device)s no longer exists on %(agent_id)s"), {'device': device, 'agent_id': agent_id}) - port = self.get_port_from_device(device) + plugin = manager.NeutronManager.get_plugin() + port = plugin.get_port_from_device(device) if port: entry = {'device': device, 'exists': True} @@ -93,7 +96,8 @@ class MlnxRpcCallbacks(n_rpc.RpcCallback): device = kwargs.get('device') LOG.debug(_("Device %(device)s up %(agent_id)s"), {'device': device, 'agent_id': agent_id}) - port = self.get_port_from_device(device) + plugin = manager.NeutronManager.get_plugin() + port = plugin.get_port_from_device(device) if port: if port['status'] != q_const.PORT_STATUS_ACTIVE: # Set port status to ACTIVE