From 7f8e32befc9f136a5b40af5adbdba8221acd4cdf Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 16 Dec 2020 16:30:39 +0900 Subject: [PATCH] Fix logic to honor HorizonDebug Debug always has one of true/false and is always set. We should check whether HorizonDebug is set instead of whether Debug is set. Also, this change fixes the current logic to make sure that HorizonDebug: false is honored even when Debug: true is set. Closes-Bug: #1908362 Change-Id: I514b5a3d4133d3561376ea06a803d019acaa0f0b (cherry picked from commit f89140402ef211f92309646c2d935d5b9e593f99) (cheery picked from commit bb7d59c65a1c0feacfa4b05904dfe3f4ca287cdf) --- .../horizon/horizon-container-puppet.yaml | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/deployment/horizon/horizon-container-puppet.yaml b/deployment/horizon/horizon-container-puppet.yaml index 77d0589389..1642f31006 100644 --- a/deployment/horizon/horizon-container-puppet.yaml +++ b/deployment/horizon/horizon-container-puppet.yaml @@ -41,7 +41,7 @@ parameters: description: Set to True to enable debugging on all services. type: boolean HorizonDebug: - default: false + default: '' description: Set to True to enable debugging Horizon service. type: string constraints: @@ -150,7 +150,7 @@ parameter_groups: - MemcachedIPv6 conditions: - debug_unset: {equals : [{get_param: Debug}, '']} + service_debug_unset: {equals : [{get_param: HorizonDebug}, '']} websso_enabled: {equals : [{get_param: WebSSOEnable}, True]} internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} horizon_domain_choices_set: {not: {equals: [{get_param: HorizonDomainChoices}, []]}} @@ -160,12 +160,16 @@ conditions: - 6 horizon_logger_debug: or: - - yaql: - expression: $.data.horizon_debug.matches("true|True|TRUE") - data: - horizon_debug: - get_param: HorizonDebug - - get_param: Debug + - and: + - service_debug_unset + - get_param: Debug + - and: + - not: service_debug_unset + - yaql: + expression: $.data.horizon_debug.matches("true|True|TRUE") + data: + horizon_debug: + get_param: HorizonDebug resources: @@ -238,9 +242,9 @@ outputs: - {} - if: - - debug_unset - - horizon::django_debug: { get_param: HorizonDebug } + - service_debug_unset - horizon::django_debug: { get_param: Debug } + - horizon::django_debug: { get_param: HorizonDebug } - if: - horizon_logger_debug - horizon::log_level: 'DEBUG'