Merge "Register osprofiler options before setting engine hook"
This commit is contained in:
commit
ab908ed763
|
@ -23,6 +23,7 @@ from oslo_db import exception as db_exc
|
|||
from oslo_db.sqlalchemy import enginefacade
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
from osprofiler import opts as profiler_opts
|
||||
import osprofiler.sqlalchemy
|
||||
from pecan import util as p_util
|
||||
import six
|
||||
|
@ -42,6 +43,12 @@ def set_hook(engine):
|
|||
context_manager = enginefacade.transaction_context()
|
||||
|
||||
context_manager.configure(sqlite_fk=True)
|
||||
|
||||
# TODO(ihrachys) the hook assumes options defined by osprofiler, and the only
|
||||
# public function that is provided by osprofiler that will register them is
|
||||
# set_defaults, that's why we call it here even though we don't need to change
|
||||
# defaults
|
||||
profiler_opts.set_defaults(cfg.CONF)
|
||||
context_manager.append_on_engine_create(set_hook)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue