summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-02-04 15:23:58 +0000
committerMark McLoughlin <markmc@redhat.com>2013-02-05 10:50:52 +0000
commitc3da24303025f978c852dfde8babefd875322320 (patch)
tree85a42c9e577b0852637c21e3d9b520ce76bf1a82 /openstack/common
parent13a9e6dca7742493253d5b9b4bedb01d07fb242d (diff)
downloadoslo-c3da24303025f978c852dfde8babefd875322320.tar.gz
oslo-c3da24303025f978c852dfde8babefd875322320.tar.xz
oslo-c3da24303025f978c852dfde8babefd875322320.zip
Eliminate gratuitous DB difference vs Nova
Looks like this was an abritrary cleanup done as part of the import. It conflicts with a more recent change in Nova. We can move to using try_import() once we've killed the Nova copy of this code. Change-Id: I5c67d3fbd846a262feb724e26b14447a76561ae6
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/db/sqlalchemy/session.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/openstack/common/db/sqlalchemy/session.py b/openstack/common/db/sqlalchemy/session.py
index 5bd35c8..0effd5c 100644
--- a/openstack/common/db/sqlalchemy/session.py
+++ b/openstack/common/db/sqlalchemy/session.py
@@ -248,9 +248,8 @@ from eventlet import db_pool
from eventlet import greenthread
try:
import MySQLdb
- HAS_MYSQLDB = True
except ImportError:
- HAS_MYSQLDB = None
+ MySQLdb = None
from sqlalchemy.exc import DisconnectionError, OperationalError, IntegrityError
import sqlalchemy.interfaces
import sqlalchemy.orm
@@ -504,7 +503,7 @@ def create_engine(sql_connection):
if CONF.sql_connection == "sqlite://":
engine_args["poolclass"] = StaticPool
engine_args["connect_args"] = {'check_same_thread': False}
- elif all((CONF.sql_dbpool_enable, HAS_MYSQLDB,
+ elif all((CONF.sql_dbpool_enable, MySQLdb,
"mysql" in connection_dict.drivername)):
LOG.info(_("Using mysql/eventlet db_pool."))
# MySQLdb won't accept 'None' in the password field