Browse Source

Add SecurityGroupAgentRpcCallbackMixin to OVSvAppAgent

Adding SecurityGroupAgentRpcCallbackMixin OVSvAppAgent. This
fixes the error

  NoSuchMethod: Endpoint does not support RPC method
  security_groups_provider_updated

found in ovsvapp_agent logs.

Change-Id: I038c76401af91afb592243920589b9780d6ce0db
Stephen Ma 8 months ago
parent
commit
20fa0fac69

+ 6
- 1
networking_vsphere/agent/ovsvapp_agent.py View File

@@ -23,6 +23,7 @@ from oslo_config import cfg
23 23
 from oslo_log import log
24 24
 import oslo_messaging
25 25
 from oslo_service import loopingcall
26
+from osprofiler import profiler
26 27
 import six
27 28
 
28 29
 from neutron_lib.agent import topics
@@ -33,6 +34,7 @@ from neutron_lib.utils import helpers
33 34
 
34 35
 from neutron.agent.common import ovs_lib
35 36
 from neutron.agent import rpc as agent_rpc
37
+from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
36 38
 from neutron.common import rpc as n_rpc
37 39
 from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants as ovs_const  # noqa
38 40
 from neutron.plugins.ml2.drivers.openvswitch.agent import ovs_neutron_agent as ovs_agent  # noqa
@@ -80,7 +82,10 @@ class PortInfo(object):
80 82
         self.network_type = network_type
81 83
 
82 84
 
83
-class OVSvAppAgent(agent.Agent, ovs_agent.OVSNeutronAgent):
85
+@profiler.trace_cls("rpc")
86
+class OVSvAppAgent(agent.Agent,
87
+                   ovs_agent.OVSNeutronAgent,
88
+                   sg_rpc.SecurityGroupAgentRpcCallbackMixin):
84 89
 
85 90
     """OVSvApp Agent."""
86 91
 

+ 2
- 2
networking_vsphere/tests/unit/agent/test_ovsvapp_agent.py View File

@@ -341,8 +341,8 @@ class TestOVSvAppAgent(base.TestCase):
341 341
     @mock.patch('networking_vsphere.agent.ovsvapp_agent.OVSvAppPluginApi')
342 342
     @mock.patch('neutron_lib.context.get_admin_context_without_session')
343 343
     @mock.patch('neutron.agent.rpc.create_consumers')
344
-    @mock.patch('neutron.plugins.ml2.drivers.openvswitch.agent.'
345
-                'ovs_neutron_agent.OVSNeutronAgent.setup_integration_br')
344
+    @mock.patch('networking_vsphere.agent.ovsvapp_agent.OVSvAppAgent.'
345
+                'setup_integration_br')
346 346
     @mock.patch('networking_vsphere.agent.ovsvapp_agent.'
347 347
                 'OVSvAppAgent.check_ovsvapp_agent_restart')
348 348
     @mock.patch('networking_vsphere.agent.ovsvapp_agent.'

Loading…
Cancel
Save