Stop using deprecated rpc_backend option

oslo.messaging deprecated the rpc_backend option long ago, but it was
still being used in cinder unit test configuration fixtures. oslo.messaging
9.0.0 finally removed that option, so now the tests are failing.

This change replaces use of rpc_backend with the corresponding
transport_url option that as recommended at:

https://docs.openstack.org/oslo.messaging/latest/configuration/conffixture.html

It also removes a redundant setUp() override.

Change-Id: I7cc823e96da1fd38ba28650b72a358e792d7c892
Closes-Bug: #1796759
This commit is contained in:
imacdonn 2018-10-08 20:47:20 +00:00
parent 7929594226
commit 978f02d219
5 changed files with 6 additions and 10 deletions

View File

@ -91,7 +91,7 @@ class AdminActionsTest(BaseAdminTest):
group='oslo_concurrency')
self.fixture.config(disable_process_locking=True,
group='oslo_concurrency')
self.flags(rpc_backend='cinder.openstack.common.rpc.impl_fake')
self.flags(transport_url='fake:/')
cast_as_call.mock_cast_as_call(self.volume_api.volume_rpcapi.client)
cast_as_call.mock_cast_as_call(self.volume_api.scheduler_rpcapi.client)

View File

@ -86,7 +86,7 @@ class VolumeActionsTest(test.TestCase):
self.addCleanup(self.db_get_patcher.stop)
self.mock_volume_db_get.return_value = vol
self.flags(rpc_backend='cinder.openstack.common.rpc.impl_fake')
self.flags(transport_url='fake:/')
def test_simple_api_actions(self):
app = fakes.wsgi_app(fake_auth_context=self.context)
@ -514,7 +514,7 @@ class VolumeRetypeActionsTest(test.TestCase):
self.context = context.RequestContext(fake.USER_ID, fake.PROJECT_ID,
is_admin=False)
self.flags(rpc_backend='cinder.openstack.common.rpc.impl_fake')
self.flags(transport_url='fake:/')
self.retype_mocks = {}
paths = ('cinder.quota.QUOTAS.add_volume_type_opts',

View File

@ -38,7 +38,7 @@ def set_defaults(conf):
'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
group=configuration.SHARED_CONF_GROUP)
conf.set_default('target_helper', 'fake')
conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake')
conf.set_default('transport_url', 'fake:/')
conf.set_default('connection', 'sqlite://', group='database')
conf.set_default('sqlite_synchronous', False, group='database')
conf.set_default('policy_file', 'cinder.tests.unit/policy.json',

View File

@ -2524,7 +2524,7 @@ class HuaweiISCSIDriverTestCase(HuaweiTestBase):
super(HuaweiISCSIDriverTestCase, self).setUp()
self.configuration = mock.Mock(spec=conf.Configuration)
self.configuration.hypermetro_devices = hypermetro_devices
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
self.flags(transport_url='fake:/')
self.driver = FakeISCSIStorage(configuration=self.configuration)
self.driver.do_setup()
self.portgroup = 'portgroup-test'
@ -4594,7 +4594,7 @@ class HuaweiFCDriverTestCase(HuaweiTestBase):
def setUp(self):
super(HuaweiFCDriverTestCase, self).setUp()
self.configuration = mock.Mock(spec=conf.Configuration)
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
self.flags(transport_url='fake:/')
self.huawei_conf = FakeHuaweiConf(self.configuration, 'FC')
self.configuration.hypermetro_devices = hypermetro_devices
driver = FakeFCStorage(configuration=self.configuration)

View File

@ -46,10 +46,6 @@ target_list = ['20240002ac000a50']
class TestFCZoneManager(test.TestCase):
@mock.patch('oslo_config.cfg._is_opt_registered', return_value=False)
def setUp(self, opt_mock):
super(TestFCZoneManager, self).setUp()
def __init__(self, *args, **kwargs):
super(TestFCZoneManager, self).__init__(*args, **kwargs)