Remove use of deprecated oslo.db options

oslo.db 10.0.0 finally removes the deprecated '[database] idle_timeout'
option in favour of '[database] connection_recycle_time'. Update unit
tests to reflect this.

Change-Id: I3628f1cd438f3f2ca999ec89df4eef989c903b95
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2021-07-06 14:35:25 +01:00
parent 123691fe53
commit cb113ef89b
6 changed files with 3 additions and 58 deletions

View File

@ -5,7 +5,7 @@
#connection = mysql+pymysql://keystone:keystone@localhost/keystone?charset=utf8
#To Test PostgreSQL:
#connection = postgresql://keystone:keystone@localhost/keystone?client_encoding=utf8
idle_timeout = 200
connection_recycle_time = 200
[ldap]
url = fake://memory

View File

@ -6,4 +6,4 @@ connection = sqlite://
#connection = mysql+pymysql://keystone:keystone@localhost/keystone?charset=utf8
#To Test PostgreSQL:
#connection = postgresql://keystone:keystone@localhost/keystone?client_encoding=utf8
idle_timeout = 200
connection_recycle_time = 200

View File

@ -5,4 +5,4 @@
#connection = mysql+pymysql://keystone:keystone@localhost/keystone?charset=utf8
#To Test PostgreSQL:
#connection = postgresql://keystone:keystone@localhost/keystone?client_encoding=utf8
idle_timeout = 200
connection_recycle_time = 200

View File

@ -1,8 +0,0 @@
# Options in this file are deprecated. See test_config.
[sql]
# These options were deprecated in Icehouse with the switch to oslo's
# db.sqlalchemy.
connection = sqlite://deprecated
idle_timeout = 54321

View File

@ -1,15 +0,0 @@
# Options in this file are deprecated. See test_config.
[sql]
# These options were deprecated in Icehouse with the switch to oslo's
# db.sqlalchemy.
connection = sqlite://deprecated
idle_timeout = 54321
[database]
# These are the new options from the [sql] section.
connection = sqlite://new
idle_timeout = 65432

View File

@ -41,35 +41,3 @@ class ConfigTestCase(unit.TestCase):
self.assertIsNone(CONF.auth.token)
# Check config.set_config_defaults() has set [profiler]enabled.
self.assertEqual(False, CONF.profiler.enabled)
class DeprecatedTestCase(unit.TestCase):
"""Test using the original (deprecated) name for renamed options."""
def config_files(self):
config_files = super(DeprecatedTestCase, self).config_files()
config_files.append(unit.dirs.tests_conf('deprecated.conf'))
return config_files
def test_sql(self):
# Options in [sql] were moved to [database] in Icehouse for the change
# to use oslo-incubator's db.sqlalchemy.sessions.
self.assertEqual('sqlite://deprecated', CONF.database.connection)
self.assertEqual(54321, CONF.database.idle_timeout)
class DeprecatedOverrideTestCase(unit.TestCase):
"""Test using the deprecated AND new name for renamed options."""
def config_files(self):
config_files = super(DeprecatedOverrideTestCase, self).config_files()
config_files.append(unit.dirs.tests_conf('deprecated_override.conf'))
return config_files
def test_sql(self):
# Options in [sql] were moved to [database] in Icehouse for the change
# to use oslo-incubator's db.sqlalchemy.sessions.
self.assertEqual('sqlite://new', CONF.database.connection)
self.assertEqual(65432, CONF.database.idle_timeout)