Merge "do not use str(url) to stringify a URL for subsequent use"
This commit is contained in:
commit
8a9bf456ad
@ -69,8 +69,10 @@ class BaseWalkMigrationTestCase(object):
|
|||||||
database functionality (reset default settings and session cleanup).
|
database functionality (reset default settings and session cleanup).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
CONF.set_override('uri', str(engine.url),
|
CONF.set_override(
|
||||||
group='drivers:management_store:sqlalchemy')
|
'uri',
|
||||||
|
engine.url.render_as_string(hide_password=False),
|
||||||
|
group='drivers:management_store:sqlalchemy')
|
||||||
|
|
||||||
def _alembic_command(self, alembic_command, engine, *args, **kwargs):
|
def _alembic_command(self, alembic_command, engine, *args, **kwargs):
|
||||||
"""Most of alembic command return data into output.
|
"""Most of alembic command return data into output.
|
||||||
@ -78,8 +80,10 @@ class BaseWalkMigrationTestCase(object):
|
|||||||
We should redefine this setting for getting info.
|
We should redefine this setting for getting info.
|
||||||
"""
|
"""
|
||||||
self.ALEMBIC_CONFIG.stdout = buf = io.StringIO()
|
self.ALEMBIC_CONFIG.stdout = buf = io.StringIO()
|
||||||
CONF.set_override('uri', str(engine.url),
|
CONF.set_override(
|
||||||
group='drivers:management_store:sqlalchemy')
|
'uri',
|
||||||
|
engine.url.render_as_string(hide_password=False),
|
||||||
|
group='drivers:management_store:sqlalchemy')
|
||||||
|
|
||||||
getattr(command, alembic_command)(*args, **kwargs)
|
getattr(command, alembic_command)(*args, **kwargs)
|
||||||
res = buf.getvalue().strip()
|
res = buf.getvalue().strip()
|
||||||
@ -180,8 +184,10 @@ class TestModelsMigrationsSync(t_m.ModelsMigrationsSync):
|
|||||||
return self.engine
|
return self.engine
|
||||||
|
|
||||||
def db_sync(self, engine):
|
def db_sync(self, engine):
|
||||||
CONF.set_override('uri', str(engine.url),
|
CONF.set_override(
|
||||||
group='drivers:management_store:sqlalchemy')
|
'uri',
|
||||||
|
engine.url.render_as_string(hide_password=False),
|
||||||
|
group='drivers:management_store:sqlalchemy')
|
||||||
script_location = os.path.join(self.mg_path, 'alembic_migrations')
|
script_location = os.path.join(self.mg_path, 'alembic_migrations')
|
||||||
self.ALEMBIC_CONFIG.set_main_option('script_location', script_location)
|
self.ALEMBIC_CONFIG.set_main_option('script_location', script_location)
|
||||||
alembic.command.upgrade(self.ALEMBIC_CONFIG, 'head')
|
alembic.command.upgrade(self.ALEMBIC_CONFIG, 'head')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user