Merge "Fix coverage2sql-db-manage to read config"

This commit is contained in:
Jenkins 2017-02-08 03:01:15 +00:00 committed by Gerrit Code Review
commit 79b9482238
2 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,8 @@ def setup():
pool_size = CONF.database.max_pool_size
pool_recycle = CONF.database.idle_timeout
if not pool_size and not pool_recycle:
if db_uri.get_backend_name() == 'sqlite' or (not pool_size
and not pool_recycle):
engine = create_engine(db_uri)
else:
engine = create_engine(db_uri,

View File

@ -23,6 +23,7 @@ from alembic import util as alembic_util
from oslo_config import cfg
from coverage2sql.db import api as db_api
from coverage2sql import shell
HEAD_FILENAME = 'HEAD'
@ -177,7 +178,9 @@ def main():
config.set_main_option('script_location',
'coverage2sql:migrations')
config.coverage2sql_config = CONF
CONF.register_cli_opts(shell.DATABASE_OPTS, group='database')
CONF()
db_api.get_session()
CONF.command.func(config, CONF.command.name)
if __name__ == "__main__":