Blame SOURCES/bz1707969-1-ocf_log-do-not-log-debug-when-HA_debug-unset.patch

b94b9d
From aae26ca70ef910e83485778c1fb450941fe79e8a Mon Sep 17 00:00:00 2001
b94b9d
From: Michele Baldessari <michele@acksyn.org>
b94b9d
Date: Mon, 3 Dec 2018 16:48:14 +0100
b94b9d
Subject: [PATCH] Do not log at debug log level when HA_debug is unset
b94b9d
b94b9d
There might be situations (e.g. bundles) where the HA_debug variable
b94b9d
is unset. It makes little sense to enable debug logging when the HA_debug env
b94b9d
variable is unset.
b94b9d
So let's skip debug logs when HA_debug is set to 0 or is unset.
b94b9d
b94b9d
Tested inside a bundle and observed that previously seen 'ocf_log debug'
b94b9d
calls are now correctly suppressed (w/ HA_debug being unset inside the
b94b9d
container)
b94b9d
b94b9d
Signed-off-by: Michele Baldessari <michele@acksyn.org>
b94b9d
---
b94b9d
 heartbeat/ocf-shellfuncs.in | 2 +-
b94b9d
 1 file changed, 1 insertion(+), 1 deletion(-)
b94b9d
b94b9d
diff --git a/heartbeat/ocf-shellfuncs.in b/heartbeat/ocf-shellfuncs.in
b94b9d
index 043ab9bf2..b17297e1a 100644
b94b9d
--- a/heartbeat/ocf-shellfuncs.in
b94b9d
+++ b/heartbeat/ocf-shellfuncs.in
b94b9d
@@ -257,7 +257,7 @@ ha_log()
b94b9d
 
b94b9d
 ha_debug() {
b94b9d
 
b94b9d
-        if [ "x${HA_debug}" = "x0" ] ; then
b94b9d
+        if [ "x${HA_debug}" = "x0" ] || [ -z "${HA_debug}" ] ; then
b94b9d
                 return 0
b94b9d
         fi
b94b9d
 	if tty >/dev/null; then