diff --git a/zun/common/profiler.py b/zun/common/profiler.py index 72d5b286e..5db59e53b 100644 --- a/zun/common/profiler.py +++ b/zun/common/profiler.py @@ -56,7 +56,7 @@ class WsgiMiddleware(object): def setup(binary, host): - if CONF.profiler.enabled: + if profiler_initializer and CONF.profiler.enabled: profiler_initializer.init_from_conf( conf=CONF, context=context.get_admin_context().to_dict(), diff --git a/zun/conf/profiler.py b/zun/conf/profiler.py index d0f68c0fb..8041f9482 100644 --- a/zun/conf/profiler.py +++ b/zun/conf/profiler.py @@ -22,6 +22,8 @@ def register_opts(conf): def list_opts(): + if not profiler_opts: + return {} return { profiler_opts._profiler_opt_group: profiler_opts._PROFILER_OPTS }