Browse Source

Fixes securitygroups_rpc usage

Some neutron.agent.securitygroups_rpc classes moved to
neutron.api.rpc.handlers.securitygroups_rpc, and they were removed
from master.

Because of this, the networking-hyperv agents can't start.

Change-Id: Iffa271bc837fa19134097b364dc1c7afc277d32e
Claudiu Belu 1 year ago
parent
commit
f10a2bbaf2

+ 4
- 3
networking_hyperv/neutron/agent/hyperv_neutron_agent.py View File

@@ -19,7 +19,8 @@ import sys
19 19
 
20 20
 from neutron.agent.l2.extensions import qos as qos_extension
21 21
 from neutron.agent import rpc as agent_rpc
22
-from neutron.agent import securitygroups_rpc as sg_rpc
22
+from neutron.agent import securitygroups_rpc as sg_agent_rpc
23
+from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
23 24
 from neutron.common import config as common_config
24 25
 from neutron.common import topics
25 26
 from neutron.conf.agent import common as neutron_config
@@ -43,11 +44,11 @@ LOG = logging.getLogger(__name__)
43 44
 _port_synchronized = c_util.get_port_synchronized_decorator('n-hv-agent-')
44 45
 
45 46
 
46
-class HyperVSecurityAgent(sg_rpc.SecurityGroupAgentRpc):
47
+class HyperVSecurityAgent(sg_agent_rpc.SecurityGroupAgentRpc):
47 48
 
48 49
     def __init__(self, context, plugin_rpc):
49 50
         super(HyperVSecurityAgent, self).__init__(context, plugin_rpc)
50
-        if sg_rpc.is_firewall_enabled():
51
+        if sg_agent_rpc.is_firewall_enabled():
51 52
             self._setup_rpc()
52 53
 
53 54
     @property

+ 2
- 1
networking_hyperv/tests/unit/neutron/agent/test_hyperv_neutron_agent.py View File

@@ -111,7 +111,8 @@ class TestHyperVNeutronAgent(base.HyperVBaseTestCase):
111 111
                          agent_configurations["tunneling_ip"])
112 112
 
113 113
     @mock.patch("networking_hyperv.neutron.trunk_driver.HyperVTrunkDriver")
114
-    @mock.patch("neutron.agent.securitygroups_rpc.SecurityGroupServerRpcApi")
114
+    @mock.patch("neutron.api.rpc.handlers.securitygroups_rpc."
115
+                "SecurityGroupServerRpcApi")
115 116
     @mock.patch("networking_hyperv.neutron.agent.hyperv_neutron_agent"
116 117
                 ".HyperVSecurityAgent")
117 118
     @mock.patch.object(layer2.Layer2Agent, "_setup")

Loading…
Cancel
Save