From 64caeb6baef488054a00e552d2fd30081e75ee70 Mon Sep 17 00:00:00 2001 From: asmita singh Date: Mon, 19 Nov 2018 07:05:17 +0000 Subject: [PATCH] Fix enabled log_exchange issue If log_exchange is enabled, it fails to load v2 app. This patch fixes this issue by initializing debug middleware after setup_app method as 'Debug' middleware expects global_conf type as dict instead of 'pecan.conf' which doesn't have copy method. Change-Id: I65742b261b7b1429b399a78d19cdaf85ef28b917 Closes-Bug: #1803037 --- blazar/api/v2/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/blazar/api/v2/app.py b/blazar/api/v2/app.py index 9da6a294..fe97505c 100644 --- a/blazar/api/v2/app.py +++ b/blazar/api/v2/app.py @@ -55,10 +55,6 @@ def setup_app(pecan_config=None, extra_hooks=None): guess_content_type_from_ext=False ) - # WSGI middleware for debugging - if CONF.log_exchange: - app = debug.Debug.factory(pecan_config)(app) - # WSGI middleware for Keystone auth # NOTE(sbauza): ACLs are always active unless for unittesting where # enable_acl could be set to False @@ -78,4 +74,7 @@ def make_app(): } # NOTE(sbauza): Fill Pecan config and call modules' path app.setup_app() app = pecan.load_app(config) + # WSGI middleware for debugging + if CONF.log_exchange: + app = debug.Debug.factory(config)(app) return app