Merge "Hyper-V: Fixes security groups issue" into stable/juno
This commit is contained in:
commit
c072de4a6b
|
@ -100,6 +100,10 @@ class HyperVSecurityAgent(n_rpc.RpcCallback,
|
|||
self.topic,
|
||||
consumers)
|
||||
|
||||
@property
|
||||
def use_enhanced_rpc(self):
|
||||
return False
|
||||
|
||||
|
||||
class HyperVSecurityCallbackMixin(n_rpc.RpcCallback,
|
||||
sg_rpc.SecurityGroupAgentRpcCallbackMixin):
|
||||
|
|
|
@ -56,6 +56,7 @@ class TestHyperVNeutronAgent(base.BaseTestCase):
|
|||
self.agent = hyperv_neutron_agent.HyperVNeutronAgent()
|
||||
self.agent.plugin_rpc = mock.Mock()
|
||||
self.agent.sec_groups_agent = mock.MagicMock()
|
||||
self.agent.sg_plugin_rpc = mock.Mock()
|
||||
self.agent.context = mock.Mock()
|
||||
self.agent.agent_id = mock.Mock()
|
||||
|
||||
|
@ -68,6 +69,11 @@ class TestHyperVNeutronAgent(base.BaseTestCase):
|
|||
'start_flag': True}
|
||||
self.agent_state = fake_agent_state
|
||||
|
||||
def test_use_enhanced_rpc(self):
|
||||
self.agent.sec_groups_agent = hyperv_neutron_agent.HyperVSecurityAgent(
|
||||
self.agent.context, self.agent.sg_plugin_rpc)
|
||||
self.assertFalse(self.agent.sec_groups_agent.use_enhanced_rpc)
|
||||
|
||||
def test_port_bound_enable_metrics(self):
|
||||
cfg.CONF.set_override('enable_metrics_collection', True, 'AGENT')
|
||||
self._test_port_bound(True)
|
||||
|
|
Loading…
Reference in New Issue