Merge "test: make enforce_type=True in CONF.set_override"

This commit is contained in:
Jenkins 2016-01-19 13:58:36 +00:00 committed by Gerrit Code Review
commit b2b6ae662b
3 changed files with 8 additions and 5 deletions

View File

@ -40,7 +40,7 @@ class SaharaTestCase(base.BaseTestCase):
tenant_name=tenant_name, **kwargs))
def override_config(self, name, override, group=None):
main.CONF.set_override(name, override, group)
main.CONF.set_override(name, override, group, enforce_type=True)
self.addCleanup(main.CONF.clear_override, name, group)

View File

@ -60,7 +60,8 @@ class BaseWalkMigrationTestCase(object):
should use oslo_config and openstack.commom.db.sqlalchemy.session with
database functionality (reset default settings and session cleanup).
"""
CONF.set_override('connection', str(engine.url), group='database')
CONF.set_override('connection', str(engine.url), group='database',
enforce_type=True)
sa.cleanup()
def _alembic_command(self, alembic_command, engine, *args, **kwargs):
@ -69,7 +70,8 @@ class BaseWalkMigrationTestCase(object):
We should redefine this setting for getting info.
"""
self.ALEMBIC_CONFIG.stdout = buf = io.StringIO()
CONF.set_override('connection', str(engine.url), group='database')
CONF.set_override('connection', str(engine.url), group='database',
enforce_type=True)
sa.cleanup()
getattr(command, alembic_command)(*args, **kwargs)
res = buf.getvalue().strip()
@ -171,7 +173,8 @@ class TestModelsMigrationsSync(t_m.ModelsMigrationsSync):
return self.engine
def db_sync(self, engine):
CONF.set_override('connection', str(engine.url), group='database')
CONF.set_override('connection', str(engine.url), group='database',
enforce_type=True)
alembic.command.upgrade(self.ALEMBIC_CONFIG, 'head')
def get_metadata(self):

View File

@ -66,7 +66,7 @@ def validate_config():
'{supported}). Falling back to Cinder API version 2.')
.format(bad=CONF.cinder.api_version,
supported=[1, 2]))
CONF.set_override('api_version', 2, group='cinder')
CONF.set_override('api_version', 2, group='cinder', enforce_type=True)
def client():