summaryrefslogtreecommitdiffstats
path: root/openstack/common/db/sqlalchemy
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-11 18:43:09 +0000
committerGerrit Code Review <review@openstack.org>2013-06-11 18:43:09 +0000
commit109e1b525dc96fd2d523dbc41c018ee975030e82 (patch)
treec33556b56380515caca0219f49e4f2f69bb3dcb8 /openstack/common/db/sqlalchemy
parent165b98415d3949f8a9dddbdbc1f304fb7d257718 (diff)
parent7119e29cb535426c587eaf2cfc2cfcd11a422df0 (diff)
downloadoslo-109e1b525dc96fd2d523dbc41c018ee975030e82.tar.gz
oslo-109e1b525dc96fd2d523dbc41c018ee975030e82.tar.xz
oslo-109e1b525dc96fd2d523dbc41c018ee975030e82.zip
Merge "Enable hacking H404 test."
Diffstat (limited to 'openstack/common/db/sqlalchemy')
-rw-r--r--openstack/common/db/sqlalchemy/session.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/openstack/common/db/sqlalchemy/session.py b/openstack/common/db/sqlalchemy/session.py
index cb8fcf9..b5e10f1 100644
--- a/openstack/common/db/sqlalchemy/session.py
+++ b/openstack/common/db/sqlalchemy/session.py
@@ -384,8 +384,7 @@ def cleanup():
class SqliteForeignKeysListener(PoolListener):
- """
- Ensures that the foreign key constraints are enforced in SQLite.
+ """Ensures that the foreign key constraints are enforced in SQLite.
The foreign key constraints are disabled by default in SQLite,
so the foreign key constraints will be enabled here for every
@@ -444,7 +443,8 @@ _DUP_KEY_RE_DB = {
def _raise_if_duplicate_entry_error(integrity_error, engine_name):
- """
+ """Raise exception if two entries are duplicated.
+
In this function will be raised DBDuplicateEntry exception if integrity
error wrap unique constraint violation.
"""
@@ -487,7 +487,8 @@ _DEADLOCK_RE_DB = {
def _raise_if_deadlock_error(operational_error, engine_name):
- """
+ """Raise exception on deadlock condition.
+
Raise DBDeadlock exception if OperationalError contains a Deadlock
condition.
"""
@@ -566,19 +567,17 @@ def _add_regexp_listener(dbapi_con, con_record):
def _greenthread_yield(dbapi_con, con_record):
- """
- Ensure other greenthreads get a chance to execute by forcing a context
- switch. With common database backends (eg MySQLdb and sqlite), there is
- no implicit yield caused by network I/O since they are implemented by
- C libraries that eventlet cannot monkey patch.
+ """Ensure other greenthreads get a chance to be executed.
+
+ Force a context switch. With common database backends (eg MySQLdb and
+ sqlite), there is no implicit yield caused by network I/O since they are
+ implemented by C libraries that eventlet cannot monkey patch.
"""
greenthread.sleep(0)
def _ping_listener(dbapi_conn, connection_rec, connection_proxy):
- """
- Ensures that MySQL connections checked out of the
- pool are alive.
+ """Ensures that MySQL connections checked out of the pool are alive.
Borrowed from:
http://groups.google.com/group/sqlalchemy/msg/a4ce563d802c929f
@@ -716,8 +715,9 @@ def get_maker(engine, autocommit=True, expire_on_commit=False):
def _patch_mysqldb_with_stacktrace_comments():
- """Adds current stack trace as a comment in queries by patching
- MySQLdb.cursors.BaseCursor._do_query.
+ """Adds current stack trace as a comment in queries.
+
+ Patches MySQLdb.cursors.BaseCursor._do_query.
"""
import MySQLdb.cursors
import traceback