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 f89140402e)
(cherry picked from commit bb7d59c65a)
This commit is contained in:
Takashi Kajinami 2020-12-16 16:30:39 +09:00
parent 79aec182b3
commit d3c837e818
1 changed files with 14 additions and 10 deletions

View File

@ -44,7 +44,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:
@ -136,17 +136,21 @@ parameters:
file: /var/log/containers/horizon/horizon.log
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_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:
@ -219,9 +223,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'