DNM: Debugging

Change-Id: I6931d274dbe5e3edcbaba7c621744c3a83acc364
This commit is contained in:
Takashi Kajinami 2024-04-19 18:32:09 +09:00
parent d8d1bf432d
commit a51d91af46
3 changed files with 8 additions and 4 deletions

View File

@ -162,9 +162,13 @@ class Connection(base.Connection):
engine = enginefacade.writer.get_engine() engine = enginefacade.writer.get_engine()
ctxt = migration.MigrationContext.configure(engine.connect()) ctxt = migration.MigrationContext.configure(engine.connect())
current_version = ctxt.get_current_revision() current_version = ctxt.get_current_revision()
LOG.debug("current version: %s", str(current_version))
if current_version is None: if current_version is None:
LOG.debug("Creating schema")
models.Base.metadata.create_all(engine, checkfirst=False) models.Base.metadata.create_all(engine, checkfirst=False)
LOG.debug("Schema created. Stamping ...")
command.stamp(cfg, "head") command.stamp(cfg, "head")
LOG.debug("Stamped")
else: else:
command.upgrade(cfg, "head") command.upgrade(cfg, "head")

View File

@ -12,17 +12,17 @@ keys = console
keys = generic keys = generic
[logger_root] [logger_root]
level = WARN level = DEBUG
handlers = console handlers = console
qualname = qualname =
[logger_sqlalchemy] [logger_sqlalchemy]
level = WARN level = DEBUG
handlers = handlers =
qualname = sqlalchemy.engine qualname = sqlalchemy.engine
[logger_alembic] [logger_alembic]
level = WARN level = DEBUG
handlers = handlers =
qualname = alembic qualname = alembic

View File

@ -226,7 +226,7 @@ function init_aodh {
if is_service_enabled mysql postgresql; then if is_service_enabled mysql postgresql; then
if [ "$AODH_BACKEND" = 'mysql' ] || [ "$AODH_BACKEND" = 'postgresql' ] ; then if [ "$AODH_BACKEND" = 'mysql' ] || [ "$AODH_BACKEND" = 'postgresql' ] ; then
recreate_database aodh recreate_database aodh
$AODH_BIN_DIR/aodh-dbsync $AODH_BIN_DIR/aodh-dbsync --debug
fi fi
fi fi
} }