Updated openstack/openstack
Project: openstack/oslo.db  20ccbf2bbf7309711e139485ff0b590b109996e4

Port _is_db_connection_error check to exception filters

The last part where we are handling DB exceptions is the
_is_db_connection_error() function, which is called within a retry
loop inside of session.create_engine() to perform an initial
connection test.  SQLAlchemy currently does not run "connect"
errors through the exception handling system.  In order to have
these exceptions participate in the filtering system, add
a new function handle_connect_error(engine) which runs
engine.connect() and feeds the exception into the
handler(context) system directly, producing a compatible context
that the filters can use.   Refactor the looping mechanism within
session.create_engine() into a separate function _test_connection()
so that the logic is encapsulated and can be tested.

partially implement bp: use-events-for-error-wrapping

Change-Id: Iad1bac9d0f9202b21e4c9c170aa84494b770728d