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

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