Merge "Replace DbMigrationError with DBMigrationError"

This commit is contained in:
Zuul
2017-10-26 02:41:42 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -223,7 +223,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)

View File

@@ -215,7 +215,7 @@ class TestCinderManageCmd(test.TestCase):
@mock.patch("oslo_db.sqlalchemy.migration.db_sync")
def test_db_commands_script_not_present(self, db_sync):
db_sync.side_effect = oslo_exception.DbMigrationError
db_sync.side_effect = oslo_exception.DBMigrationError(None)
db_cmds = cinder_manage.DbCommands()
exit = self.assertRaises(SystemExit, db_cmds.sync, 101)
self.assertEqual(1, exit.code)