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."

Related--Bug: #1517839

Change-Id: Id45669d982d1a045cddd47123943531453c2124d
This commit is contained in:
ChangBo Guo(gcb) 2017-05-22 22:43:45 +08:00
parent 27f7114411
commit 3815f8ddfe
3 changed files with 5 additions and 9 deletions

View File

@ -62,10 +62,8 @@ class GdnsdAgentBackendTestCase(TestCase):
self.zones_dir_path = os.path.join(self.conf_dir_path, 'zones')
os.mkdir(self.zones_dir_path)
self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf
cfg.CONF.set_override('confdir_path', self.conf_dir_path,
CFG_GROUP, enforce_type=True)
cfg.CONF.set_override('gdnsd_cmd_name', GDNSD_BIN_PATH,
CFG_GROUP, enforce_type=True)
cfg.CONF.set_override('confdir_path', self.conf_dir_path, CFG_GROUP)
cfg.CONF.set_override('gdnsd_cmd_name', GDNSD_BIN_PATH, CFG_GROUP)
self.backend = GdnsdBackend('foo')

View File

@ -314,8 +314,7 @@ class CentralServiceTestCase(CentralBasic):
self.assertTrue(designate.central.service.quota.get_quota.called)
def test__is_valid_ttl(self):
self.CONF.set_override('min_ttl', 10, 'service:central',
enforce_type=True)
self.CONF.set_override('min_ttl', 10, 'service:central')
self.service._is_valid_ttl(self.context, 20)
# policy.check() not to raise: the user is allowed to create low TTLs

View File

@ -98,8 +98,7 @@ class SchedulerTest(test.BaseTestCase):
cfg.CONF.set_override(
'scheduler_filters',
['random'],
'service:central',
enforce_type=True)
'service:central')
test_scheduler = scheduler.get_scheduler(storage=mock_storage)
@ -109,7 +108,7 @@ class SchedulerTest(test.BaseTestCase):
def test_no_filters_enabled(self):
cfg.CONF.set_override(
'scheduler_filters', [], 'service:central', enforce_type=True)
'scheduler_filters', [], 'service:central')
attrs = {
'find_pools.return_value': objects.PoolList()