Merge "Fix sqlalchemy with osprofiler"

This commit is contained in:
Zuul 2024-12-04 12:18:16 +00:00 committed by Gerrit Code Review
commit e20a7e5423

View File

@ -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