From ba81ce0cb127145a6d0138d692953b95e264f4af Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 5 Sep 2022 17:38:58 +0100 Subject: [PATCH] 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. Signed-off-by: Stephen Finucane Change-Id: I57b8cce28c2ad7899b831067c94b9d913f3f1334 --- heat/db/sqlalchemy/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/heat/db/sqlalchemy/api.py b/heat/db/sqlalchemy/api.py index 619ca7cc24..31e6a5c786 100644 --- a/heat/db/sqlalchemy/api.py +++ b/heat/db/sqlalchemy/api.py @@ -65,7 +65,9 @@ LOG = logging.getLogger(__name__) # TODO(sbaker): fix tests so that sqlite_fk=True can be passed to configure -db_context.configure() +# FIXME(stephenfin): we need to remove reliance on autocommit semantics ASAP +# since it's not compatible with SQLAlchemy 2.0 +db_context.configure(__autocommit=True) def get_facade():