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

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