summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oslo_db/sqlalchemy/utils.py4
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]