From b83b1ba90c19c7f08724435286995ac56d118a3d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 20 Sep 2016 12:34:58 +0200 Subject: [PATCH] sqlalchemy: remove Ceilometer upgrade workaround This was used to allow upgrade to Newton from Liberty/Mitaka and should not be needed anymore. Change-Id: I7cb8b54c21951b8adf3891d58940d7f7d5e02a96 --- aodh/storage/impl_sqlalchemy.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/aodh/storage/impl_sqlalchemy.py b/aodh/storage/impl_sqlalchemy.py index 53da0e61d..80901e8e6 100644 --- a/aodh/storage/impl_sqlalchemy.py +++ b/aodh/storage/impl_sqlalchemy.py @@ -20,7 +20,6 @@ import os.path from alembic import command from alembic import config from alembic import migration -from oslo_db import exception from oslo_db.sqlalchemy import session as db_session from oslo_db.sqlalchemy import utils as oslo_sql_utils from oslo_log import log @@ -95,15 +94,8 @@ class Connection(base.Connection): ctxt = migration.MigrationContext.configure(engine.connect()) current_version = ctxt.get_current_revision() if current_version is None: - try: - models.Base.metadata.create_all(engine, checkfirst=False) - except exception.DBError: - # Assume tables exist from Ceilometer, take control - # FIXME(jd) Remove in Ocata - command.stamp(cfg, "12fe8fac9fe4") - command.upgrade(cfg, "head") - else: - command.stamp(cfg, "head") + models.Base.metadata.create_all(engine, checkfirst=False) + command.stamp(cfg, "head") else: command.upgrade(cfg, "head")