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:
Boden R 2018-04-12 11:58:34 -06:00
parent 87eb1b15be
commit 3bbeb64b90
6 changed files with 6 additions and 6 deletions

View File

@ -86,7 +86,7 @@ class FWaaSV2AgentExtension(l2_extension.L2AgentExtension):
self.agent_api = agent_api
def start_rpc_listeners(self):
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
endpoints = [self]
self.conn.create_consumer(consts.FW_AGENT, endpoints, fanout=False)
return self.conn.consume_in_threads()

View File

@ -73,7 +73,7 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension):
def start_rpc_listeners(self, conf):
self.endpoints = [self]
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
self.conn.create_consumer(
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
return self.conn.consume_in_threads()

View File

@ -90,7 +90,7 @@ class FWaaSL3AgentExtension(l3_extension.L3AgentExtension):
def start_rpc_listeners(self, host, conf):
self.endpoints = [self]
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
self.conn.create_consumer(
fwaas_constants.FW_AGENT, self.endpoints, fanout=False)
return self.conn.consume_in_threads()

View File

@ -166,7 +166,7 @@ class FirewallPlugin(
def start_rpc_listeners(self):
self.endpoints = [FirewallCallbacks(self)]
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
self.conn.create_consumer(
f_const.FIREWALL_PLUGIN, self.endpoints, fanout=False)
return self.conn.consume_in_threads()

View File

@ -185,7 +185,7 @@ class FirewallPluginV2(
def start_rpc_listeners(self):
self.endpoints = [FirewallCallbacks(self)]
self.conn = n_rpc.create_connection()
self.conn = n_rpc.Connection()
self.conn.create_consumer(
fwaas_constants.FIREWALL_PLUGIN, self.endpoints, fanout=False)
return self.conn.consume_in_threads()

View File

@ -60,7 +60,7 @@ class TestFWaasV2AgentExtension(TestFWaasV2AgentExtensionBase):
cfg.CONF.set_override('firewall_l2_driver', 'ovs', group='fwaas')
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.driver.assert_called_with('neutron.agent.l2.firewall_drivers',
'ovs')