File pacemaker-tools-suppress-invalid-error-message-crm_resource-force.patch of Package pacemaker.14737

commit 8ebea35cbd5022396e6578eafd546201e8c359ef
Author: Keisuke MORI <kskmori@intellilink.co.jp>
Date:   Fri Oct 13 09:37:09 2017 +0900

    Low: tools: suppress an invalid error message for crm_resource --force-* options

Index: pacemaker/tools/crm_resource.c
===================================================================
--- pacemaker.orig/tools/crm_resource.c
+++ pacemaker/tools/crm_resource.c
@@ -411,6 +411,7 @@ main(int argc, char **argv)
     bool require_crmd = FALSE;    /* whether command requires connection to CRMd */
 
     int rc = pcmk_ok;
+    int is_ocf_rc = 0;
     int option_index = 0;
     int timeout_ms = 0;
     int argerr = 0;
@@ -823,6 +824,9 @@ main(int argc, char **argv)
 
     } else if (rsc_cmd == 0 && rsc_long_cmd) { /* force-(stop|start|check) */
         rc = cli_resource_execute(rsc_id, rsc_long_cmd, override_params, cib_conn, &data_set);
+        if (rc >= 0) {
+            is_ocf_rc = 1;
+        }
 
     } else if (rsc_cmd == 'A' || rsc_cmd == 'a') {
         GListPtr lpc = NULL;
@@ -1199,7 +1203,7 @@ main(int argc, char **argv)
         CMD_ERR("Error performing operation: %s", pcmk_strerror(rc));
         CMD_ERR("Try using -f");
 
-    } else if (rc != pcmk_ok) {
+    } else if (rc != pcmk_ok && !is_ocf_rc) {
         CMD_ERR("Error performing operation: %s", pcmk_strerror(rc));
     }
 
openSUSE Build Service is sponsored by