use rpc Connection rather than create_connection
The create_connection function in neutron.common.rpc is just an alias to Connection. This patch switches to the later so we can remove the former in: https://review.openstack.org/#/c/560130 Change-Id: I3ebb94c00becfb2d468470260a99ac2741a7ee81
This commit is contained in:
parent
87eb1b15be
commit
3bbeb64b90
@ -86,7 +86,7 @@ class FWaaSV2AgentExtension(l2_extension.L2AgentExtension):
|
|||||||
self.agent_api = agent_api
|
self.agent_api = agent_api
|
||||||
|
|
||||||
def start_rpc_listeners(self):
|
def start_rpc_listeners(self):
|
||||||
self.conn = n_rpc.create_connection()
|
self.conn = n_rpc.Connection()
|
||||||
endpoints = [self]
|
endpoints = [self]
|
||||||
self.conn.create_consumer(consts.FW_AGENT, endpoints, fanout=False)
|
self.conn.create_consumer(consts.FW_AGENT, endpoints, fanout=False)
|
||||||
return self.conn.consume_in_threads()
|
return self.conn.consume_in_threads()
|
||||||
|
@ -73,7 +73,7 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension):
|
|||||||
def start_rpc_listeners(self, conf):
|
def start_rpc_listeners(self, conf):
|
||||||
self.endpoints = [self]
|
self.endpoints = [self]
|
||||||
|
|
||||||
self.conn = n_rpc.create_connection()
|
self.conn = n_rpc.Connection()
|
||||||
self.conn.create_consumer(
|
self.conn.create_consumer(
|
||||||
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
|
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
|
||||||
return self.conn.consume_in_threads()
|
return self.conn.consume_in_threads()
|
||||||
|
@ -90,7 +90,7 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension):
|
|||||||
def start_rpc_listeners(self, host, conf):
|
def start_rpc_listeners(self, host, conf):
|
||||||
self.endpoints = [self]
|
self.endpoints = [self]
|
||||||
|
|
||||||
self.conn = n_rpc.create_connection()
|
self.conn = n_rpc.Connection()
|
||||||
self.conn.create_consumer(
|
self.conn.create_consumer(
|
||||||
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
|
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
|
||||||
return self.conn.consume_in_threads()
|
return self.conn.consume_in_threads()
|
||||||
|
@ -166,7 +166,7 @@ class FirewallPlugin(
|
|||||||
def start_rpc_listeners(self):
|
def start_rpc_listeners(self):
|
||||||
self.endpoints = [FirewallCallbacks(self)]
|
self.endpoints = [FirewallCallbacks(self)]
|
||||||
|
|
||||||
self.conn = n_rpc.create_connection()
|
self.conn = n_rpc.Connection()
|
||||||
self.conn.create_consumer(
|
self.conn.create_consumer(
|
||||||
f_const.FIREWALL_PLUGIN, self.endpoints, fanout=False)
|
f_const.FIREWALL_PLUGIN, self.endpoints, fanout=False)
|
||||||
return self.conn.consume_in_threads()
|
return self.conn.consume_in_threads()
|
||||||
|
@ -185,7 +185,7 @@ class FirewallPluginV2(
|
|||||||
def start_rpc_listeners(self):
|
def start_rpc_listeners(self):
|
||||||
self.endpoints = [FirewallCallbacks(self)]
|
self.endpoints = [FirewallCallbacks(self)]
|
||||||
|
|
||||||
self.conn = n_rpc.create_connection()
|
self.conn = n_rpc.Connection()
|
||||||
self.conn.create_consumer(
|
self.conn.create_consumer(
|
||||||
fwaas_constants.FIREWALL_PLUGIN, self.endpoints, fanout=False)
|
fwaas_constants.FIREWALL_PLUGIN, self.endpoints, fanout=False)
|
||||||
return self.conn.consume_in_threads()
|
return self.conn.consume_in_threads()
|
||||||
|
@ -60,7 +60,7 @@ class TestFWaasV2AgentExtension(TestFWaasV2AgentExtensionBase):
|
|||||||
cfg.CONF.set_override('firewall_l2_driver', 'ovs', group='fwaas')
|
cfg.CONF.set_override('firewall_l2_driver', 'ovs', group='fwaas')
|
||||||
|
|
||||||
def test_initialize(self):
|
def test_initialize(self):
|
||||||
with mock.patch('neutron.common.rpc.create_connection') as conn:
|
with mock.patch('neutron.common.rpc.Connection') as conn:
|
||||||
self.l2.initialize(None, 'ovs')
|
self.l2.initialize(None, 'ovs')
|
||||||
self.driver.assert_called_with('neutron.agent.l2.firewall_drivers',
|
self.driver.assert_called_with('neutron.agent.l2.firewall_drivers',
|
||||||
'ovs')
|
'ovs')
|
||||||
|
Loading…
Reference in New Issue
Block a user