diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-09-27 17:00:53 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-09-27 17:00:53 +0000 |
| commit | d6b460e2e87e573500f6b521939895c6d93f5fdf (patch) | |
| tree | 01367fd003e823c8ef7e94b9a78792da32ce4562 | |
| parent | d2ac401fbb6620700772ed2abb5a6e9296ff3a93 (diff) | |
| parent | f3dd56e916232e38e74d9e2f24ce9a738cac63cf (diff) | |
Merge "Removed db_pool complexities from nova.db.sqlalchemy.session. Fixes bug 838581."
| -rw-r--r-- | nova/db/sqlalchemy/session.py | 34 | ||||
| -rw-r--r-- | nova/flags.py | 6 |
2 files changed, 1 insertions, 39 deletions
diff --git a/nova/db/sqlalchemy/session.py b/nova/db/sqlalchemy/session.py index 643e2338e..74ee5ed80 100644 --- a/nova/db/sqlalchemy/session.py +++ b/nova/db/sqlalchemy/session.py @@ -15,30 +15,16 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -""" -Session Handling for SQLAlchemy backend -""" -import eventlet.patcher -eventlet.patcher.monkey_patch() +"""Session Handling for SQLAlchemy backend.""" -import eventlet.db_pool import sqlalchemy.orm -import sqlalchemy.pool import nova.exception import nova.flags -import nova.log FLAGS = nova.flags.FLAGS -LOG = nova.log.getLogger("nova.db.sqlalchemy") - - -try: - import MySQLdb -except ImportError: - MySQLdb = None _ENGINE = None @@ -71,24 +57,6 @@ def get_engine(): if "sqlite" in connection_dict.drivername: engine_args["poolclass"] = sqlalchemy.pool.NullPool - elif MySQLdb and "mysql" in connection_dict.drivername: - LOG.info(_("Using mysql/eventlet db_pool.")) - # MySQLdb won't accept 'None' in the password field - password = connection_dict.password or '' - pool_args = { - "db": connection_dict.database, - "passwd": password, - "host": connection_dict.host, - "user": connection_dict.username, - "min_size": FLAGS.sql_min_pool_size, - "max_size": FLAGS.sql_max_pool_size, - "max_idle": FLAGS.sql_idle_timeout, - } - creator = eventlet.db_pool.ConnectionPool(MySQLdb, **pool_args) - engine_args["pool_size"] = FLAGS.sql_max_pool_size - engine_args["pool_timeout"] = FLAGS.sql_pool_timeout - engine_args["creator"] = creator.create - return sqlalchemy.create_engine(FLAGS.sql_connection, **engine_args) diff --git a/nova/flags.py b/nova/flags.py index fab099660..5dde02adf 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -353,12 +353,6 @@ DEFINE_string('logdir', None, 'output to a per-service log file in named ' 'directory') DEFINE_integer('logfile_mode', 0644, 'Default file mode of the logs.') DEFINE_string('sqlite_db', 'nova.sqlite', 'file name for sqlite') -DEFINE_integer('sql_pool_timeout', 30, - 'seconds to wait for connection from pool before erroring') -DEFINE_integer('sql_min_pool_size', 10, - 'minimum number of SQL connections to pool') -DEFINE_integer('sql_max_pool_size', 10, - 'maximum number of SQL connections to pool') DEFINE_string('sql_connection', 'sqlite:///$state_path/$sqlite_db', 'connection string for sql database') |
