Merge "Replace usage of get_legacy_facade() with get_engine()"

This commit is contained in:
Zuul 2018-11-20 11:23:18 +00:00 committed by Gerrit Code Review
commit a9bb2c9652

View File

@ -62,7 +62,9 @@ def get_engine(use_slave=False, connection=None):
:param connection: The database connection string :param connection: The database connection string
""" """
ctxt_mgr = create_context_manager(connection=connection) ctxt_mgr = create_context_manager(connection=connection)
return ctxt_mgr.get_legacy_facade().get_engine(use_slave=use_slave) if use_slave:
return ctxt_mgr.reader.get_engine()
return ctxt_mgr.writer.get_engine()
class SQLRepository(object): class SQLRepository(object):