Fix coverage2sql-db-manage to read config
This commit fixes coverage2sql-db-manage to read config file correctly. In the previous version, coverage2sql-db-manage command doesn't work. I'm not sure when it didn't work, though. Change-Id: If3bb93a661a723b0ff0eedf9f0ed84c2af8d88e6
This commit is contained in:
parent
da5a5a934a
commit
ff8f03ece5
|
@ -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,
|
||||
|
|
|
@ -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__":
|
||||
|
|
Loading…
Reference in New Issue