Skip to content

Commit 15b2bfb

Browse files
priteaustephenfin
andcommitted
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. Co-Authored-By: Stephen Finucane <stephenfin@redhat.com> Change-Id: Ia0e9696dcaafd90f9c6daeb68c72fa2b184823fb (cherry picked from commit 0ea32a2)
1 parent c9340b3 commit 15b2bfb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cloudkitty/db/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
def _create_facade_lazily():
2323
global _FACADE
2424
if _FACADE is None:
25-
_FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True)
25+
# FIXME(priteau): Remove autocommit=True (and ideally use of
26+
# LegacyEngineFacade) asap since it's not compatible with SQLAlchemy
27+
# 2.0.
28+
_FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk=True,
29+
autocommit=True)
2630
return _FACADE
2731

2832

0 commit comments

Comments
 (0)