diff options
author | Zuul <zuul@review.opendev.org> | 2022-07-20 15:55:24 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-07-20 15:55:24 +0000 |
commit | 1234d38b963460bb0cf8c34ccd95b5029f16342f (patch) | |
tree | 9c403171927d06e8d99fc8b62a40ee13eb98c526 | |
parent | a808381414b3bed60b59f17e75e39cb4d8652426 (diff) | |
parent | 43142792502afe5e5ce29a4cc3c291f673ef066e (diff) | |
download | oslo-db-1234d38b963460bb0cf8c34ccd95b5029f16342f.tar.gz |
Merge "Add missing 'connect' wrapper"
-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] |