Merge "Conditionally import ibmdb2/ibm_db_sa"

This commit is contained in:
Jenkins 2014-03-04 20:38:53 +00:00 committed by Gerrit Code Review
commit 716124f2ad

View File

@ -8,8 +8,7 @@ from migrate.changeset.databases import (sqlite,
postgres,
mysql,
oracle,
firebird,
ibmdb2)
firebird)
# Map SA dialects to the corresponding Migrate extensions
@ -21,10 +20,19 @@ DIALECTS = {
"mysql": mysql.MySQLDialect,
"oracle": oracle.OracleDialect,
"firebird": firebird.FBDialect,
"ibm_db_sa": ibmdb2.IBMDBDialect
}
# NOTE(mriedem): We have to conditionally check for DB2 in case ibm_db_sa
# isn't available since ibm_db_sa is not packaged in sqlalchemy like the
# other dialects.
try:
from migrate.changeset.databases import ibmdb2
DIALECTS["ibm_db_sa"] = ibmdb2.IBMDBDialect
except ImportError:
pass
def get_engine_visitor(engine, name):
"""
Get the visitor implementation for the given database engine.