The example configuration refers to slave_connection[1] but slaves aren't used
in the codebase. This change will enable plugin authors to use
slave_connection by passing use_slave=True to the SQLAlchemy session[2][3].
[1] http://docs.openstack.org/juno/config-reference/content/section_neutron.conf.html
[2] http://docs.openstack.org/developer/oslo.db/api/sqlalchemy/session.html#oslo_db.sqlalchemy.session.EngineFacade.get_session
[3] https://wiki.openstack.org/wiki/Slave_usage
Change-Id: I6f46c11fad5c58577654a4011cf82d19f6d3e1e3
get_engine().pool.dispose()
-def get_session(autocommit=True, expire_on_commit=False):
+def get_session(autocommit=True, expire_on_commit=False, use_slave=False):
"""Helper method to grab session."""
facade = _create_facade_lazily()
return facade.get_session(autocommit=autocommit,
- expire_on_commit=expire_on_commit)
+ expire_on_commit=expire_on_commit,
+ use_slave=use_slave)
@contextlib.contextmanager