diff --git a/ceilometer/api/app.py b/ceilometer/api/app.py index b507eeb3..61eb94aa 100644 --- a/ceilometer/api/app.py +++ b/ceilometer/api/app.py @@ -46,9 +46,8 @@ OPTS = [ API_OPTS = [ cfg.BoolOpt('pecan_debug', - help='Toggle Pecan Debug Middleware. ' - 'If it is not set, global debug value will be used.' - ), + default=False, + help='Toggle Pecan Debug Middleware.'), ] CONF.register_opts(OPTS) @@ -78,8 +77,6 @@ def setup_app(pecan_config=None, extra_hooks=None): pecan.configuration.set_config(dict(pecan_config), overwrite=True) - cfg.set_defaults(API_OPTS, pecan_debug=CONF.debug) - # NOTE(sileht): pecan debug won't work in multi-process environment pecan_debug = CONF.api.pecan_debug if service.get_workers('api') != 1 and pecan_debug: diff --git a/ceilometer/tests/api/test_app.py b/ceilometer/tests/api/test_app.py index ca473ee6..ed7e84a3 100644 --- a/ceilometer/tests/api/test_app.py +++ b/ceilometer/tests/api/test_app.py @@ -50,7 +50,7 @@ class TestApp(base.BaseTestCase): self.assertEqual(expected, kwargs.get('debug')) _check_pecan_debug(g_debug=False, p_debug=None, expected=False) - _check_pecan_debug(g_debug=True, p_debug=None, expected=True) + _check_pecan_debug(g_debug=True, p_debug=None, expected=False) _check_pecan_debug(g_debug=True, p_debug=False, expected=False) _check_pecan_debug(g_debug=False, p_debug=True, expected=True) _check_pecan_debug(g_debug=True, p_debug=None, expected=False,