]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix a bug in Mellanox plugin RPC caused by secgroup RPC refactoring
authorAkihiro Motoki <motoki@da.jp.nec.com>
Mon, 1 Sep 2014 13:24:54 +0000 (22:24 +0900)
committerAkihiro Motoki <motoki@da.jp.nec.com>
Mon, 1 Sep 2014 13:41:57 +0000 (22:41 +0900)
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

neutron/plugins/mlnx/rpc_callbacks.py

index d2252d3505436c4aa2306f54ca440243ad74532f..2acfb43500d7c20df23365ffca5fbf36d4e4b967 100644 (file)
@@ -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