File pacemaker-tools-trace-log-level-for-RAs.patch of Package pacemaker.openSUSE_Leap_42.3_Update

commit 0a281d160ad7eebe6eeea4d9d0f920ccaa7ae9f5
Author: Keisuke MORI <kskmori@intellilink.co.jp>
Date:   Thu Oct 19 14:33:26 2017 +0900

    Low: tools: differentiate trace log level for RAs

diff --git a/tools/crm_resource.c b/tools/crm_resource.c
index 385f132c9..442295346 100644
--- a/tools/crm_resource.c
+++ b/tools/crm_resource.c
@@ -566,7 +566,7 @@ main(int argc, char **argv)
                 }
                 break;
             case 'V':
-                do_trace = TRUE;
+                resource_verbose++;
                 crm_bump_log_level(argc, argv);
                 break;
             case '$':
diff --git a/tools/crm_resource.h b/tools/crm_resource.h
index 2242913c3..041ad6e46 100644
--- a/tools/crm_resource.h
+++ b/tools/crm_resource.h
@@ -38,7 +38,7 @@ extern bool print_pending;
 extern bool scope_master;
 extern bool do_force;
 extern bool BE_QUIET;
-extern bool do_trace;
+extern int resource_verbose;
 
 extern int cib_options;
 extern int crmd_replies_needed;
diff --git a/tools/crm_resource_runtime.c b/tools/crm_resource_runtime.c
index 1ddd1aa12..58c8029a3 100644
--- a/tools/crm_resource_runtime.c
+++ b/tools/crm_resource_runtime.c
@@ -19,7 +19,7 @@
 
 #include <crm_resource.h>
 
-bool do_trace = FALSE;
+int resource_verbose = 0;
 bool do_force = FALSE;
 int crmd_replies_needed = 1; /* The welcome message */
 
@@ -1525,8 +1525,8 @@ cli_resource_execute(const char *rsc_id, const char *rsc_action, GHashTable *ove
     }
 
 
-    setenv("HA_debug", do_trace ? "1" : "0", 1);
-    if(do_trace) {
+    setenv("HA_debug", resource_verbose > 0 ? "1" : "0", 1);
+    if(resource_verbose > 1) {
         setenv("OCF_TRACE_RA", "1", 1);
     }
 
@@ -1556,7 +1556,7 @@ cli_resource_execute(const char *rsc_id, const char *rsc_action, GHashTable *ove
         }
 
         /* hide output for validate-all if not in verbose */
-        if (!do_trace && safe_str_eq(action, "validate-all"))
+        if (resource_verbose == 0 && safe_str_eq(action, "validate-all"))
             goto done;
 
         if (op->stdout_data) {
openSUSE Build Service is sponsored by