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

View File

@ -44,22 +44,10 @@ main_context_manager = enginefacade.transaction_context()
def _get_db_conf(conf_group, connection=None): def _get_db_conf(conf_group, connection=None):
kw = dict(conf_group.items())
return {'connection': connection or conf_group.connection, if connection is not None:
'slave_connection': conf_group.slave_connection, kw['connection'] = connection
'sqlite_fk': False, return kw
'__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}
def _context_manager_from_context(context): def _context_manager_from_context(context):