Added check to see whether oslotest is installed

The projects that are using oslo.db in tests need to explicitly
include oslotest in their test-requirements.

Closes-bug: 1356425

Change-Id: I0ed01e141221d19af5593857c13a656f32d0f3cf
Add get_non_innodb_tables() to utils

Add a helper function to utils for detection of tables which aren't
using InnoDB storage engine in MySQL (something we want to enforce in
consuming projects).

Change-Id: I22889e23b025fc32fe76e4086cd3cd3d5bd0b771
Use dialect dispatch for engine initiailization.

This patch makes use of the new DialectFunctionDispatcher
to remove all conditional logic from within session.create_engine().
The flags that result in various engine connect arguments as well
as subsequent event listeners now fall under the realm of dispatched
functions keyed to their target dialects.   Additionally, this
modernizes the SQLite foreign keys listener to use events.

A test suite is added which via mocks asserts that arguments
expected to be present as well as non-present for a variety of url situations
is added.

Change-Id: Iba5e77e1396eda46ac2c6d6cbca159cbfadf4d04
Consolidate sqlite and mysql event listeners

This patch refactors the SQLite and MySQL event listener
setup in session.py to occur inline within the
new _init_events() hooks for each of these backends.  This
is to improve code readability and reduce unneeded boilerplate.

In particular, _mysql_set_mode_callback() was implemented using
four functions, all private to session.py, unused anywhere
else and also not consistently prefixed with "_mysql".
These functions have been consolidated into a single event
listen plus a quick check of SQL mode.   In particular,
the system now emits the logging check for "sql_mode"
in all cases.

On the SQLite side, three functions, again not all prefixed
with _sqlite, are consolidated into a single event listening
function wihtin _init_events().

The test suite is altered in several ways.  The tests
for connect arguments no longer inject a sqlite engine
into session.create_engine(); now that MySQL does a particular
statement every time, this was no longer feasible, and in general
other setup functions might emit SQL also, so the
CreateEngineTest tests now test directly into session._init_connection_args.
The tests for MySQL modes and SQLite connection settings
move into being plain round-trip tests, reducing lots of
mocking logic and ultimately doing a more complete test against
a real backend.

Change-Id: I04ca3fbb1f46a64ed6552496ae995f77aa0b2315
Remove reliance on create_engine() from TestsExceptionFilter

As we are continuing to add functionality to create_engine()
which in some cases means that backend-specific SQL is
emitted on connect, the practice of repurposing a
SQLite or other engine to act like another one for the
purposes of a test is becoming less feasible.   Here,
TestsExceptionFilter is altered to not rely upon the full
session.create_engine() process for unit tests, instead
calling upon just those listeners being tested.

Change-Id: I0ece42f956c59eab7a6cb86419d8d359250d5e71
Merge "Added check to see whether oslotest is installed"
Updated from global requirements

Change-Id: I834ba5e6a6d583370099b5c87d28680a67a802c1
Merge "Consolidate sqlite and mysql event listeners"
Merge "Remove reliance on create_engine() from TestsExceptionFilter"
Merge "Updated from global requirements"
Extract logging setup into a separate function

Change-Id: I9f1761a5332ad3c4a8f0b76c6f46fc687fd61aa5
Repair pysqlite transaction support

This patch applies the events discussed in
SQLAlchemy documentation at
http://docs.sqlalchemy.org/en/rel_0_9/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl
which correct for pysqlite's modifications to SQLite's transactional
cycle.   We turn off pysqlite's automatic emit of BEGIN
as well as COMMIT before any DDL, and instead emit our own
BEGIN at the point where SQLAlchemy knows a transaction is to start.
A proof of concept is added to illustrate SAVEPOINT working
completely.

SAVEPOINT support will be needed in order to support
transactional testing with rollbacks inside of tests.

Change-Id: Ie39bd2287173327903523b66160653608d9e8652
Use oslo.i18n

Module `gettextutils` from common code was graduated to oslo.i18n, so it
would be great if we reuse this library.

Change-Id: Ie5836b82723fc80c1d54e5e65eac8565cf905c5a
Add doc8 to tox environment docs

Check reStructuredText documents for common style issues.

Change-Id: I10e61742e86d2d4781c5a00532c8e17d38a7d4b4
Merge "Use oslo.i18n"
Imported Translations from Transifex

Change-Id: Ic2108aab91b04e337f6a68e0275ec2806dc1a3e8
Updated from global requirements

Change-Id: Ic7d77a737d3e16f4f781baebe8ce57d04db04832
Merge "Add doc8 to tox environment docs"
Merge "Updated from global requirements"
ModelsMigrationsSync:Override compare_server_default

This test showed an error with alembic 0.6.6:
For MySQL Integer server_default value is compared incorrectly.
For example, when model has DefaultClause('0', for_update=False)
alembic finds it different from server variant "'0'".
For PostgreSQL Sting server_default value is compared incorrectly.
For example, when model has DefaultClause('', for_update=False)
alembic finds it different from server variant "''::character varying".

Such error appear in implementation of ModelsMigrationsSync to Neutron
https://review.openstack.org/76520.

Change-Id: I9730da1c0790a88f81570c51c36cc0cbe0651a5a