Skip to content

Commit e20a7e5

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix sqlalchemy with osprofiler"
2 parents 2e631dd + ea2619f commit e20a7e5

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)