summaryrefslogtreecommitdiffstats
path: root/openstack/common/db/sqlalchemy/session.py
diff options
context:
space:
mode:
authorDina Belova <dbelova@mirantis.com>2013-06-03 17:44:55 +0400
committerDina Belova <dbelova@mirantis.com>2013-06-11 18:28:29 +0400
commit7119e29cb535426c587eaf2cfc2cfcd11a422df0 (patch)
treeee61f4db5c8ef559a9c50c5c501fb6c421f41fa0 /openstack/common/db/sqlalchemy/session.py
parentebaa578351c9c6b47c2f28ef6d74451e1483036b (diff)
downloadoslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.tar.gz
oslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.tar.xz
oslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.zip
Enable hacking H404 test.
H404 - multi line docstring should start with a summary. Change-Id: I2099e1ee81ff9657f7a07401b8e8f3327d03bdbd
Diffstat (limited to 'openstack/common/db/sqlalchemy/session.py')
-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