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: If68f13287b7c2aedb5ef6e4bafcafc929f90789d
This commit is contained in:
Boden R 2018-04-10 15:19:51 -06:00 committed by Adit Sarfaty
parent 9743a4d0e4
commit 06986e7359
5 changed files with 6 additions and 6 deletions

View File

@ -84,7 +84,7 @@ class DhcpMetadataAccess(object):
def _setup_rpc_dhcp_metadata(self, notifier=None): def _setup_rpc_dhcp_metadata(self, notifier=None):
self.topic = topics.PLUGIN self.topic = topics.PLUGIN
self.conn = n_rpc.create_connection() self.conn = n_rpc.Connection()
self.endpoints = [SynchronizedDhcpRpcCallback(), self.endpoints = [SynchronizedDhcpRpcCallback(),
agents_db.AgentExtRpcCallback(), agents_db.AgentExtRpcCallback(),
metadata_rpc.MetadataRpcCallback()] metadata_rpc.MetadataRpcCallback()]

View File

@ -423,7 +423,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
self.endpoints = [agents_db.AgentExtRpcCallback()] self.endpoints = [agents_db.AgentExtRpcCallback()]
self.topic = topics.PLUGIN self.topic = topics.PLUGIN
self.conn = n_rpc.create_connection() self.conn = n_rpc.Connection()
self.conn.create_consumer(self.topic, self.endpoints, fanout=False) self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
self.start_rpc_listeners_called = True self.start_rpc_listeners_called = True

View File

@ -794,7 +794,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
self._setup_rpc() self._setup_rpc()
self.topic = topics.PLUGIN self.topic = topics.PLUGIN
self.conn = n_rpc.create_connection() self.conn = n_rpc.Connection()
self.conn.create_consumer(self.topic, self.endpoints, fanout=False) self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
self.conn.create_consumer(topics.REPORTS, self.conn.create_consumer(topics.REPORTS,
[agents_db.AgentExtRpcCallback()], [agents_db.AgentExtRpcCallback()],

View File

@ -92,7 +92,7 @@ class ConfigurationTest(base.BaseTestCase):
self.assertEqual('whatever', cluster.nsx_default_interface_name) self.assertEqual('whatever', cluster.nsx_default_interface_name)
def _get_mh_plugin(self): def _get_mh_plugin(self):
with mock.patch("neutron.common.rpc.create_connection"): with mock.patch("neutron.common.rpc.Connection"):
plugin = mh_plugin.NsxPlugin() plugin = mh_plugin.NsxPlugin()
return plugin return plugin
@ -249,7 +249,7 @@ class OldNVPConfigurationTest(base.BaseTestCase):
self.config_parse(args=['--config-file', BASE_CONF_PATH, self.config_parse(args=['--config-file', BASE_CONF_PATH,
'--config-file', NVP_INI_DEPR_PATH]) '--config-file', NVP_INI_DEPR_PATH])
cfg.CONF.set_override('core_plugin', vmware.PLUGIN_NAME) cfg.CONF.set_override('core_plugin', vmware.PLUGIN_NAME)
with mock.patch("neutron.common.rpc.create_connection"): with mock.patch("neutron.common.rpc.Connection"):
plugin = mh_plugin.NsxPlugin() plugin = mh_plugin.NsxPlugin()
cluster = plugin.cluster cluster = plugin.cluster
# Verify old nvp_* params have been fully parsed # Verify old nvp_* params have been fully parsed

View File

@ -295,7 +295,7 @@ class SyncTestCase(testlib_api.SqlTestCase):
self.config_parse(args=args) self.config_parse(args=args)
cfg.CONF.set_override('allow_overlapping_ips', True) cfg.CONF.set_override('allow_overlapping_ips', True)
with mock.patch("neutron.common.rpc.create_connection"): with mock.patch("neutron.common.rpc.Connection"):
self._plugin = plugin.NsxPlugin() self._plugin = plugin.NsxPlugin()
mock_nm_get_plugin = mock.patch( mock_nm_get_plugin = mock.patch(