diff options
author | Stephen Finucane <stephenfin@redhat.com> | 2021-08-16 15:37:34 +0100 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2022-02-08 14:46:26 +0000 |
commit | 43142792502afe5e5ce29a4cc3c291f673ef066e (patch) | |
tree | 838fea207b9a2aabdbe9f6a1b212ec67afb66f68 /oslo_db | |
parent | 6ecce8996188a63ba18c607dd10dd58c9c21f2b8 (diff) | |
download | oslo-db-43142792502afe5e5ce29a4cc3c291f673ef066e.tar.gz |
Add missing 'connect' wrapper
This was missed in change Ib789cd4d11a3d5dd01fcdb99822025b11bbc234e
("Don't rely on implicit autocommit")
Change-Id: I9ec27650ae5e36099a6d2b2d59bb66cd820e8ffc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db')
-rw-r--r-- | oslo_db/sqlalchemy/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/oslo_db/sqlalchemy/utils.py b/oslo_db/sqlalchemy/utils.py index 3a6a993..e5b3531 100644 --- a/oslo_db/sqlalchemy/utils.py +++ b/oslo_db/sqlalchemy/utils.py @@ -1162,7 +1162,9 @@ def get_non_ndbcluster_tables(connectable, skip_tables=None): params['database'] = connectable.engine.url.database query = text(query_str) - nonndbcluster = connectable.execute(query, **params) + # TODO(stephenfin): What about if this is already a Connection? + with connectable.connect() as conn, conn.begin(): + nonndbcluster = connectable.execute(query, **params) return [i[0] for i in nonndbcluster] |