Merge "Replace DbMigrationError with DBMigrationError"
This commit is contained in:
commit
b0653a1564
|
@ -65,7 +65,7 @@ class DbCommands(object):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
return db_migration.db_sync(version)
|
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)
|
print("Error during database migration: %s" % ex)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ class TestKarborManageCmd(base.TestCase):
|
||||||
|
|
||||||
@mock.patch("oslo_db.sqlalchemy.migration.db_sync")
|
@mock.patch("oslo_db.sqlalchemy.migration.db_sync")
|
||||||
def test_db_commands_script_not_present(self, 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()
|
db_cmds = karbor_manage.DbCommands()
|
||||||
exit = self.assertRaises(SystemExit, db_cmds.sync, 101)
|
exit = self.assertRaises(SystemExit, db_cmds.sync, 101)
|
||||||
self.assertEqual(1, exit.code)
|
self.assertEqual(1, exit.code)
|
||||||
|
|
Loading…
Reference in New Issue