Skip to content

Commit ea2619f

Browse files
committed
Fix sqlalchemy with osprofiler
Breakage seen in magnum-capi-helm unit tests after [1]. [1]: https://review.opendev.org/c/openstack/magnum/+/927446 Closes-Bug: #2089934 Change-Id: I3e5560dd487525d9566930772b0c56d52d974500
1 parent d7a7f0e commit ea2619f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

magnum/db/sqlalchemy/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def _session_for_write():
6464

6565

6666
def _wrap_session(session):
67-
if CONF.profiler.enabled and CONF.profiler.trace_sqlalchemy:
67+
if (hasattr(CONF, 'profiler') and CONF.profiler.enabled and
68+
CONF.profiler.trace_sqlalchemy):
6869
session = profiler_sqlalchemy.wrap_session(sa, session)
6970
return session
7071

0 commit comments

Comments
 (0)