Fix compatibility with oslo.db 12.1.0

oslo.db 12.1.0 has changed the default value for the 'autocommit'
parameter of 'LegacyEngineFacade' from 'True' to 'False'. This is a
necessary step to ensure compatibility with SQLAlchemy 2.0. However, we
are currently relying on the autocommit behavior and need changes to
explicitly manage sessions. Until that happens, we need to override the
default.

Change-Id: I502e42d1188a5273d030d50aff310d16916b0e17
Signed-off-by: Ayumu Ueha <ueha.ayumu@fujitsu.com>
This commit is contained in:
Ayumu Ueha 2022-09-08 14:40:11 +00:00
parent d5a97c5ffb
commit fec4f537fb

View File

@ -18,6 +18,9 @@ from oslo_db.sqlalchemy import enginefacade
context_manager = enginefacade.transaction_context() context_manager = enginefacade.transaction_context()
# FIXME(ueha): we need to remove reliance on autocommit semantics ASAP
# since it's not compatible with SQLAlchemy 2.0
context_manager.configure(__autocommit=True)
_FACADE = None _FACADE = None