Merge "Generalize DB conf group copying"

This commit is contained in:
Zuul 2018-05-29 02:38:56 +00:00 committed by Gerrit Code Review
commit ebacdd46ac
1 changed files with 4 additions and 16 deletions

View File

@ -44,22 +44,10 @@ main_context_manager = enginefacade.transaction_context()
def _get_db_conf(conf_group, connection=None):
return {'connection': connection or conf_group.connection,
'slave_connection': conf_group.slave_connection,
'sqlite_fk': False,
'__autocommit': True,
'expire_on_commit': False,
'mysql_sql_mode': conf_group.mysql_sql_mode,
'idle_timeout': conf_group.idle_timeout,
'connection_debug': conf_group.connection_debug,
'max_pool_size': conf_group.max_pool_size,
'max_overflow': conf_group.max_overflow,
'pool_timeout': conf_group.pool_timeout,
'sqlite_synchronous': conf_group.sqlite_synchronous,
'connection_trace': conf_group.connection_trace,
'max_retries': conf_group.max_retries,
'retry_interval': conf_group.retry_interval}
kw = dict(conf_group.items())
if connection is not None:
kw['connection'] = connection
return kw
def _context_manager_from_context(context):