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
(cherry picked from commit ea2619f462
)
This commit is contained in:
parent
e24cc72ea0
commit
db197e08a0
@ -64,7 +64,8 @@ def _session_for_write():
|
||||
|
||||
|
||||
def _wrap_session(session):
|
||||
if CONF.profiler.enabled and CONF.profiler.trace_sqlalchemy:
|
||||
if (hasattr(CONF, 'profiler') and CONF.profiler.enabled and
|
||||
CONF.profiler.trace_sqlalchemy):
|
||||
session = profiler_sqlalchemy.wrap_session(sa, session)
|
||||
return session
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user