summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Lamar <brian.lamar@rackspace.com>2011-08-10 14:01:18 -0400
committerBrian Lamar <brian.lamar@rackspace.com>2011-08-10 14:01:18 -0400
commit93c4a691c28668d62103b2ae2f90b284950cd95f (patch)
tree9bdaf4bb43b5157b402ff9afc0fcde5dce8cfc0b
parenta46964ad11a85effa833decb81384b478a0cf75d (diff)
downloadnova-93c4a691c28668d62103b2ae2f90b284950cd95f.tar.gz
nova-93c4a691c28668d62103b2ae2f90b284950cd95f.tar.xz
nova-93c4a691c28668d62103b2ae2f90b284950cd95f.zip
Make sure to not use MySQLdb if you don't have it.
-rw-r--r--nova/db/sqlalchemy/session.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/db/sqlalchemy/session.py b/nova/db/sqlalchemy/session.py
index 726a801af..6ef2d7b2c 100644
--- a/nova/db/sqlalchemy/session.py
+++ b/nova/db/sqlalchemy/session.py
@@ -38,7 +38,7 @@ LOG = nova.log.getLogger("nova.db.sqlalchemy")
try:
import MySQLdb
except ImportError:
- LOG.debug(_("Unable to load MySQLdb module."))
+ MySQLdb = None
_ENGINE = None
@@ -72,8 +72,8 @@ def get_engine():
if "sqlite" in connection_dict.drivername:
engine_args["poolclass"] = sqlalchemy.pool.NullPool
- if "mysql" in connection_dict.drivername:
- LOG.info(_("Using MySQL/eventlet DB connection pool."))
+ if MySQLdb and "mysql" in connection_dict.drivername:
+ LOG.info(_("Using MySQLdb/eventlet DB connection pool."))
pool_args = {
"db": connection_dict.database,
"user": connection_dict.username,