summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2022-09-05 17:32:18 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2022-09-08 16:47:51 +0000
commite80c7c088962a72be8f723d92703174ce79bd425 (patch)
tree67dd38d837bcd84a6726eb4b14db7f9537937cb5
parentab80152dfe01b7bb1efe50e2d69f90a7c4a2a30f (diff)
downloadironic-e80c7c088962a72be8f723d92703174ce79bd425.tar.gz
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: I9e095d810ff5398920e8ffd4f2f089d9b8d29335 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> (cherry picked from commit 74795abf2ff972b2b848eee98426bcdfee2a9c20)
-rw-r--r--ironic/db/sqlalchemy/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ironic/db/sqlalchemy/__init__.py b/ironic/db/sqlalchemy/__init__.py
index 0f792361a..88ac079d0 100644
--- a/ironic/db/sqlalchemy/__init__.py
+++ b/ironic/db/sqlalchemy/__init__.py
@@ -13,4 +13,6 @@
from oslo_db.sqlalchemy import enginefacade
# NOTE(dtantsur): we want sqlite as close to a real database as possible.
-enginefacade.configure(sqlite_fk=True)
+# FIXME(stephenfin): we need to remove reliance on autocommit semantics ASAP
+# since it's not compatible with SQLAlchemy 2.0
+enginefacade.configure(sqlite_fk=True, __autocommit=True)