From 46b34c05b0d382bbdb5f635a9589d49dc8b839ea Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 21 Sep 2022 09:26:07 +0200 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. Note that this patch was written using this one as example: https://review.opendev.org/c/openstack/magnum/+/858374 Also include Zuul gate fix. Fix as described in [1][2] [1] https://lists.opendev.org/pipermail/service-announce/2022-September/000044.html [2] https://lists.zuul-ci.org/pipermail/zuul-discuss/2022-May/001801.html Change-Id: I963e741078514b1cca6ed0e510cefaeccdd3499a --- .zuul.yaml | 2 +- murano/db/session.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index 6ab48d75f..d72c941a4 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,5 @@ - project: + queue: murano templates: - check-requirements - openstack-cover-jobs @@ -14,7 +15,6 @@ - murano-grenade - murano-tempest-api-ipv6-only gate: - queue: murano jobs: - murano-tempest-api - murano-tempest-api-ipv6-only diff --git a/murano/db/session.py b/murano/db/session.py index 11b751a15..e94ebf63f 100644 --- a/murano/db/session.py +++ b/murano/db/session.py @@ -37,6 +37,9 @@ def _create_facade_lazily(): global _LOCK, _FACADE if _FACADE is None: + # FIXME(zigo): autocommit=True it's not compatible with + # SQLAlchemy 2.0, and will be removed in future + _FACADE = db_session.EngineFacade.from_config(CONF, autocommit=True) with _LOCK: if _FACADE is None: _FACADE = db_session.EngineFacade.from_config(CONF,