Merge "Remove usage of parameter enforce_type"

This commit is contained in:
Jenkins 2017-06-07 02:53:14 +00:00 committed by Gerrit Code Review
commit c9c6a951ee
6 changed files with 23 additions and 46 deletions

View File

@ -306,8 +306,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_cluster_create,
mock_get_datastore_version):
cfg.CONF.set_override('cluster_support', False, group='mongodb',
enforce_type=True)
cfg.CONF.set_override('cluster_support', False, group='mongodb')
body = self.cluster
tenant_id = Mock()
@ -332,8 +331,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_get_datastore_version,
mock_cluster_view_data):
cfg.CONF.set_override('cluster_support', True, group='mongodb',
enforce_type=True)
cfg.CONF.set_override('cluster_support', True, group='mongodb')
body = self.cluster
tenant_id = Mock()

View File

@ -256,8 +256,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_cluster_create,
mock_get_datastore_version):
cfg.CONF.set_override('cluster_support', False, group='pxc',
enforce_type=True)
cfg.CONF.set_override('cluster_support', False, group='pxc')
body = self.cluster
tenant_id = Mock()
@ -282,8 +281,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_get_datastore_version,
mock_cluster_view_data):
cfg.CONF.set_override('cluster_support', True, group='pxc',
enforce_type=True)
cfg.CONF.set_override('cluster_support', True, group='pxc')
body = self.cluster
tenant_id = Mock()

View File

@ -293,8 +293,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_cluster_create,
mock_get_datastore_version):
cfg.CONF.set_override('cluster_support', False, group='redis',
enforce_type=True)
cfg.CONF.set_override('cluster_support', False, group='redis')
body = self.cluster
tenant_id = Mock()
@ -323,8 +322,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_get_datastore_version,
mock_cluster_view_data):
cfg.CONF.set_override('cluster_support', True, group='redis',
enforce_type=True)
cfg.CONF.set_override('cluster_support', True, group='redis')
body = self.cluster
tenant_id = Mock()

View File

@ -256,8 +256,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_cluster_create,
mock_get_datastore_version):
cfg.CONF.set_override('cluster_support', False, group='vertica',
enforce_type=True)
cfg.CONF.set_override('cluster_support', False, group='vertica')
body = self.cluster
tenant_id = Mock()
@ -282,9 +281,7 @@ class TestClusterControllerWithStrategy(trove_testtools.TestCase):
mock_get_datastore_version,
mock_cluster_view_data):
cfg.CONF.set_override('cluster_support', True, group='vertica',
enforce_type=True)
cfg.CONF.set_override('cluster_support', True, group='vertica')
body = self.cluster
tenant_id = Mock()
context = trove_testtools.TroveTestContext(self)

View File

@ -297,8 +297,7 @@ class TestCreateCinderClient(trove_testtools.TestCase):
def test_create_with_conf_override(self):
cinder_url_from_conf = 'http://example.com'
tenant_from_ctx = uuid.uuid4().hex
cfg.CONF.set_override('cinder_url', cinder_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('cinder_url', cinder_url_from_conf)
client = remote.create_cinder_client(
TroveContext(tenant=tenant_from_ctx))
@ -308,8 +307,7 @@ class TestCreateCinderClient(trove_testtools.TestCase):
def test_create_with_conf_override_trailing_slash(self):
cinder_url_from_conf = 'http://example.com/'
tenant_from_ctx = uuid.uuid4().hex
cfg.CONF.set_override('cinder_url', cinder_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('cinder_url', cinder_url_from_conf)
client = remote.create_cinder_client(
TroveContext(tenant=tenant_from_ctx))
self.assertEqual('%s%s' % (cinder_url_from_conf, tenant_from_ctx),
@ -322,10 +320,8 @@ class TestCreateCinderClient(trove_testtools.TestCase):
client.client.management_url)
def test_create_with_catalog_all_opts(self):
cfg.CONF.set_override('cinder_service_type', 'volume',
enforce_type=True)
cfg.CONF.set_override('os_region_name', 'RegionTwo',
enforce_type=True)
cfg.CONF.set_override('cinder_service_type', 'volume')
cfg.CONF.set_override('os_region_name', 'RegionTwo')
client = remote.create_cinder_client(
TroveContext(service_catalog=self.service_catalog))
self.assertEqual(self.volume_public_url_region_two,
@ -376,8 +372,7 @@ class TestCreateNovaClient(trove_testtools.TestCase):
def test_create_with_conf_override(self):
nova_url_from_conf = 'http://example.com'
tenant_from_ctx = uuid.uuid4().hex
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf)
client = remote.create_nova_client(
TroveContext(tenant=tenant_from_ctx))
@ -387,8 +382,7 @@ class TestCreateNovaClient(trove_testtools.TestCase):
def test_create_with_conf_override_trailing_slash(self):
nova_url_from_conf = 'http://example.com/'
tenant_from_ctx = uuid.uuid4().hex
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf)
client = remote.create_nova_client(
TroveContext(tenant=tenant_from_ctx))
self.assertEqual('%s%s' % (nova_url_from_conf, tenant_from_ctx),
@ -401,10 +395,8 @@ class TestCreateNovaClient(trove_testtools.TestCase):
client.client.management_url)
def test_create_with_catalog_all_opts(self):
cfg.CONF.set_override('nova_compute_service_type', 'computev3',
enforce_type=True)
cfg.CONF.set_override('os_region_name', 'RegionTwo',
enforce_type=True)
cfg.CONF.set_override('nova_compute_service_type', 'computev3')
cfg.CONF.set_override('os_region_name', 'RegionTwo')
client = remote.create_nova_client(
TroveContext(service_catalog=self.service_catalog))
self.assertEqual(self.computev3_public_url_region_two,
@ -412,8 +404,7 @@ class TestCreateNovaClient(trove_testtools.TestCase):
def test_create_admin_client(self):
nova_url_from_conf = 'http://adminexample.com/'
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('nova_compute_url', nova_url_from_conf)
admin_user = 'admin1'
admin_pass = 'adminpwd'
admin_tenant_id = uuid.uuid4().hex
@ -471,8 +462,7 @@ class TestCreateSwiftClient(trove_testtools.TestCase):
def test_create_with_conf_override(self):
swift_url_from_conf = 'http://example.com/AUTH_'
tenant_from_ctx = uuid.uuid4().hex
cfg.CONF.set_override('swift_url', swift_url_from_conf,
enforce_type=True)
cfg.CONF.set_override('swift_url', swift_url_from_conf)
client = remote.create_swift_client(
TroveContext(tenant=tenant_from_ctx))
@ -486,10 +476,8 @@ class TestCreateSwiftClient(trove_testtools.TestCase):
client.url)
def test_create_with_catalog_all_opts(self):
cfg.CONF.set_override('swift_service_type', 'object-storev3',
enforce_type=True)
cfg.CONF.set_override('os_region_name', 'RegionTwo',
enforce_type=True)
cfg.CONF.set_override('swift_service_type', 'object-storev3')
cfg.CONF.set_override('os_region_name', 'RegionTwo')
client = remote.create_swift_client(
TroveContext(service_catalog=self.service_catalog))
self.assertEqual(self.swiftv3_public_url_region_two,

View File

@ -79,11 +79,9 @@ class MockMgmtInstanceTest(trove_testtools.TestCase):
remote, 'create_admin_nova_client', return_value=self.client)
self.addCleanup(self.admin_client_patch.stop)
self.admin_client_patch.start()
CONF.set_override('host', '127.0.0.1', enforce_type=True)
CONF.set_override('exists_notification_interval', 1,
enforce_type=True)
CONF.set_override('notification_service_id', {'mysql': '123'},
enforce_type=True)
CONF.set_override('host', '127.0.0.1')
CONF.set_override('exists_notification_interval', 1)
CONF.set_override('notification_service_id', {'mysql': '123'})
super(MockMgmtInstanceTest, self).setUp()