Blob Blame History Raw
From: Andrew Beekhof <andrew@beekhof.net>
Date: Mon, 5 Oct 2015 12:27:59 +1100
Subject: [PATCH] Log: crm_resource --restart: Improved user feedback on
 failure

(cherry picked from commit b557a39973a1fb85b2791be67dc03cfd32c22d89)
---
 tools/crm_resource_runtime.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/crm_resource_runtime.c b/tools/crm_resource_runtime.c
index a04adb9..878fd0b 100644
--- a/tools/crm_resource_runtime.c
+++ b/tools/crm_resource_runtime.c
@@ -1040,6 +1040,12 @@ cli_resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t *
     pe_working_set_t data_set;
 
     if(resource_is_running_on(rsc, host) == FALSE) {
+        const char *id = rsc->clone_name?rsc->clone_name:rsc->id;
+        if(host) {
+            printf("%s is not running on %s and so cannot be restarted\n", id, host);
+        } else {
+            printf("%s is not running anywhere and so cannot be restarted\n", id);
+        }
         return -ENXIO;
     }