Remove deprecated oslo.config messages.

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.

This option have never been useful, and now the default is already True.
So we don't need to raise requirement for this.

Change-Id: I042a5d98748e2b2c6ee8307340aa6056bf0a1dfd
This commit is contained in:
Mehdi Abaakouk 2017-04-27 12:09:29 +02:00
parent 0ed259de52
commit d8e33f7880
6 changed files with 14 additions and 24 deletions

View File

@ -385,8 +385,7 @@ class TestAlarms(TestAlarmsBase):
def test_get_alarm_forbiden(self):
pf = os.path.abspath('aodh/tests/functional/api/v2/policy.json-test')
self.CONF.set_override('policy_file', pf, group='oslo_policy',
enforce_type=True)
self.CONF.set_override('policy_file', pf, group='oslo_policy')
self.CONF.set_override('auth_mode', None, group='api')
self.app = webtest.TestApp(app.load_app(self.CONF))

View File

@ -92,8 +92,7 @@ class TestBase(test_base.BaseTestCase):
conf = service.prepare_service(argv=[], config_files=[])
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
self.CONF.set_override('connection', db_url, group="database",
enforce_type=True)
self.CONF.set_override('connection', db_url, group="database")
manager = self.DRIVER_MANAGERS.get(self.engine)
if not manager:
@ -104,7 +103,7 @@ class TestBase(test_base.BaseTestCase):
self.useFixture(self.db_manager)
self.CONF.set_override('connection', self.db_manager.url,
group="database", enforce_type=True)
group="database")
self.alarm_conn = storage.get_connection_from_config(self.CONF)
self.alarm_conn.upgrade()

View File

@ -79,8 +79,7 @@ class ConfigFixture(fixture.GabbiFixture):
conf.set_override('policy_file',
os.path.abspath(
'aodh/tests/open-policy.json'),
group='oslo_policy',
enforce_type=True)
group='oslo_policy')
conf.set_override('auth_mode', None, group='api')
parsed_url = urlparse.urlparse(db_url)
@ -89,8 +88,7 @@ class ConfigFixture(fixture.GabbiFixture):
parsed_url[2] += '-%s' % uuidutils.generate_uuid(dashed=False)
db_url = urlparse.urlunparse(parsed_url)
conf.set_override('connection', db_url, group='database',
enforce_type=True)
conf.set_override('connection', db_url, group='database')
if (parsed_url[0].startswith("mysql")
or parsed_url[0].startswith("postgresql")):

View File

@ -34,15 +34,14 @@ class EngineTest(base.BaseTestCase):
def test_get_connection(self):
self.CONF.set_override('connection', 'log://localhost',
group='database', enforce_type=True)
group='database')
engine = storage.get_connection_from_config(self.CONF)
self.assertIsInstance(engine, impl_log.Connection)
def test_get_connection_no_such_engine(self):
self.CONF.set_override('connection', 'no-such-engine://localhost',
group='database', enforce_type=True)
self.CONF.set_override('max_retries', 0, 'database',
enforce_type=True)
group='database')
self.CONF.set_override('max_retries', 0, 'database')
try:
storage.get_connection_from_config(self.CONF)
except RuntimeError as err:
@ -67,12 +66,9 @@ class ConnectionRetryTest(base.BaseTestCase):
raise ConnectionError
log_init.side_effect = x
self.CONF.set_override("connection", "log://", "database",
enforce_type=True)
self.CONF.set_override("retry_interval", 0.00001, "database",
enforce_type=True)
self.CONF.set_override("max_retries", max_retries, "database",
enforce_type=True)
self.CONF.set_override("connection", "log://", "database")
self.CONF.set_override("retry_interval", 0.00001, "database")
self.CONF.set_override("max_retries", max_retries, "database")
self.assertRaises(ConnectionError,
storage.get_connection_from_config,
self.CONF)
@ -86,7 +82,6 @@ class ConnectionConfigTest(base.BaseTestCase):
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
def test_only_default_url(self):
self.CONF.set_override("connection", "log://", group="database",
enforce_type=True)
self.CONF.set_override("connection", "log://", group="database")
conn = storage.get_connection_from_config(self.CONF)
self.assertIsInstance(conn, impl_log.Connection)

View File

@ -152,7 +152,7 @@ class TestPartitioning(base.BaseTestCase):
coordinator_cls=None):
coordinator_cls = coordinator_cls or MockToozCoordinator
self.CONF.set_override('backend_url', 'xxx://yyy',
group='coordination', enforce_type=True)
group='coordination')
with mock.patch('tooz.coordination.get_coordinator',
lambda _, member_id:
coordinator_cls(member_id, shared_storage)):

View File

@ -68,8 +68,7 @@ class TestAlarmEvaluationService(tests_base.BaseTestCase):
test_interval)
self.CONF.set_override('heartbeat',
coordination_heartbeat,
group='coordination',
enforce_type=True)
group='coordination')
self._fake_pc.is_active.return_value = coordination_active