From d37e5e346648daba016d738609ebc703fcd6e918 Mon Sep 17 00:00:00 2001 From: Yaguo Zhou Date: Tue, 5 Sep 2017 23:07:40 +0800 Subject: [PATCH] Replace DbMigrationError with DBMigrationError because DbMigrationError is deprecated Change-Id: I961a45d47cd0b0322a2484ed43692887d887a767 --- ironic/db/sqlalchemy/migration.py | 2 +- ironic/tests/unit/db/sqlalchemy/test_migrations.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ironic/db/sqlalchemy/migration.py b/ironic/db/sqlalchemy/migration.py index 2dcfef95b5..54d42fbaf9 100644 --- a/ironic/db/sqlalchemy/migration.py +++ b/ironic/db/sqlalchemy/migration.py @@ -68,7 +68,7 @@ def create_schema(config=None, engine=None): # schema, it will only add the new tables, but leave # existing as is. So we should avoid of this situation. if version(engine=engine) is not None: - raise db_exc.DbMigrationError("DB schema is already under version" + raise db_exc.DBMigrationError("DB schema is already under version" " control. Use upgrade() instead") models.Base.metadata.create_all(engine) diff --git a/ironic/tests/unit/db/sqlalchemy/test_migrations.py b/ironic/tests/unit/db/sqlalchemy/test_migrations.py index a2bb0809e7..a73a56a463 100644 --- a/ironic/tests/unit/db/sqlalchemy/test_migrations.py +++ b/ironic/tests/unit/db/sqlalchemy/test_migrations.py @@ -664,7 +664,7 @@ class MigrationCheckersMixin(object): def test_upgrade_and_create_schema(self): with patch_with_engine(self.engine): self.migration_api.upgrade('31baaf680d2b') - self.assertRaises(db_exc.DbMigrationError, + self.assertRaises(db_exc.DBMigrationError, self.migration_api.create_schema) def test_upgrade_twice(self):