Remove usage of parameter enforce_type

Oslo.config deprecated parameter enforce_type and change its default
value to True in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0. Remove the
usage of it to avoid DeprecationWarning: "Using the 'enforce_type'
argument is deprecated in version '4.0' and will be removed in version
'5.0': The argument enforce_type has changed its default value to True
and then will be removed completely."

Closes-bug: #1694616
Change-Id: I0bfda96d529ec3f8cf2691b3ffbee9df686a0fb2
This commit is contained in:
Jeremy Liu 2017-05-31 15:44:08 +08:00
parent 9b14f92357
commit 34190c5794
5 changed files with 8 additions and 15 deletions

View File

@ -71,8 +71,7 @@ class TestCase(testscenarios.TestWithScenarios, base.BaseTestCase):
super(TestCase, self).setUp()
self._conf_fixture = self.useFixture(config_fixture.Config())
self.conf = self._conf_fixture.conf
self.conf.set_override('connection', self.db_url, 'database',
enforce_type=True)
self.conf.set_override('connection', self.db_url, 'database')
self.conn = ck_db_api.get_instance()
migration = self.conn.get_migration()
migration.upgrade('head')

View File

@ -186,20 +186,17 @@ class ConfigFixture(fixture.GabbiFixture):
msg_conf = conffixture.ConfFixture(conf)
msg_conf.transport_driver = 'fake'
conf.import_group('api', 'cloudkitty.api.app')
conf.set_override('auth_strategy', 'noauth', enforce_type=True)
conf.set_override('connection', 'sqlite:///', 'database',
enforce_type=True)
conf.set_override('auth_strategy', 'noauth')
conf.set_override('connection', 'sqlite:///', 'database')
conf.set_override('policy_file',
os.path.abspath('etc/cloudkitty/policy.json'),
group='oslo_policy',
enforce_type=True)
group='oslo_policy')
conf.set_override('api_paste_config',
os.path.abspath(
'cloudkitty/tests/gabbi/gabbi_paste.ini')
)
conf.import_group('storage', 'cloudkitty.storage')
conf.set_override('backend', 'sqlalchemy', 'storage',
enforce_type=True)
conf.set_override('backend', 'sqlalchemy', 'storage')
self.conf = conf
self.conn = ck_db_api.get_instance()
migration = self.conn.get_migration()

View File

@ -40,8 +40,7 @@ class StorageTest(tests.TestCase):
super(StorageTest, self).setUp()
self._tenant_id = samples.TENANT
self._other_tenant_id = '8d3ae50089ea4142-9c6e1269db6a0b64'
self.conf.set_override('backend', self.storage_backend, 'storage',
enforce_type=True)
self.conf.set_override('backend', self.storage_backend, 'storage')
self.storage = storage.get_storage()
self.storage.init()

View File

@ -70,8 +70,7 @@ def Client(**kwargs):
class KeystoneFetcherTest(tests.TestCase):
def setUp(self):
super(KeystoneFetcherTest, self).setUp()
self.conf.set_override('backend', 'keystone', 'tenant_fetcher',
enforce_type=True)
self.conf.set_override('backend', 'keystone', 'tenant_fetcher')
self.conf.import_group('keystone_fetcher',
'cloudkitty.tenant_fetcher.keystone')

View File

@ -38,8 +38,7 @@ class OrchestratorTest(tests.TestCase):
super(OrchestratorTest, self).setUp()
messaging_conf = self.useFixture(conffixture.ConfFixture(self.conf))
messaging_conf.transport_driver = 'fake'
self.conf.set_override('backend', 'keystone', 'tenant_fetcher',
enforce_type=True)
self.conf.set_override('backend', 'keystone', 'tenant_fetcher')
self.conf.import_group('keystone_fetcher',
'cloudkitty.tenant_fetcher.keystone')