Replace DbMigrationError with DBMigrationError
DbMigrationError is deprecated and will NOT be thrown in oslo.db since oslo.db >=4.27.0, DBMigrationError will be thrown instead. Consumers should catch DBMigrationError instead of DbMigrationError Change-Id: I83ca5e90c6dfbf7e0820eb0fb4ca0c6a2001c652
This commit is contained in:
parent
bd1887ff44
commit
72f9965fd7
|
@ -65,7 +65,7 @@ class DbCommands(object):
|
|||
sys.exit(1)
|
||||
try:
|
||||
return db_migration.db_sync(version)
|
||||
except db_exc.DbMigrationError as ex:
|
||||
except db_exc.DBMigrationError as ex:
|
||||
print("Error during database migration: %s" % ex)
|
||||
sys.exit(1)
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class TestKarborManageCmd(base.TestCase):
|
|||
|
||||
@mock.patch("oslo_db.sqlalchemy.migration.db_sync")
|
||||
def test_db_commands_script_not_present(self, db_sync):
|
||||
db_sync.side_effect = db_exc.DbMigrationError
|
||||
db_sync.side_effect = db_exc.DBMigrationError(None)
|
||||
db_cmds = karbor_manage.DbCommands()
|
||||
exit = self.assertRaises(SystemExit, db_cmds.sync, 101)
|
||||
self.assertEqual(1, exit.code)
|
||||
|
|
Loading…
Reference in New Issue