]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Register ibm-db-alembic import for DB2 migrations
authorMatt Riedemann <mriedem@us.ibm.com>
Fri, 17 Apr 2015 15:47:35 +0000 (08:47 -0700)
committerMatt Riedemann <mriedem@us.ibm.com>
Fri, 17 Apr 2015 15:47:35 +0000 (08:47 -0700)
This patch adds the optional runtime dependency to support db2
for alembic migration, will not break the default mysql path.

This is needed for the IBM DB2 third party CI to work on this
project.

Closes-Bug: 1442524

Change-Id: I9db112dbdc2d02df88ad676a6b21018f1d6f1724

neutron/db/migration/alembic_migrations/env.py

index 9966f55e7975ad6af5e4bb9461baa2297778ad42..7ea6c5ca51e0a041b835b7f4badebb468a65f182 100644 (file)
@@ -23,6 +23,13 @@ from sqlalchemy import event
 from neutron.db.migration.models import head  # noqa
 from neutron.db import model_base
 
+try:
+    # NOTE(mriedem): This is to register the DB2 alembic code which
+    # is an optional runtime dependency.
+    from ibm_db_alembic.ibm_db import IbmDbImpl  # noqa # pylint: disable=unused-import
+except ImportError:
+    pass
+
 
 MYSQL_ENGINE = None