Blob Blame History Raw
commit 65e481e7966d5144a0439d16ebb2a9bcffb26506
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Wed Aug 7 14:33:26 2013 +1000

    Log: PE: Better indicate when a resource has failed

diff --git a/lib/pengine/native.c b/lib/pengine/native.c
index c1fe89d..c81a218 100644
--- a/lib/pengine/native.c
+++ b/lib/pengine/native.c
@@ -413,16 +413,20 @@ native_print(resource_t * rsc, const char *pre_text, long options, void *print_d
     if(is_set(rsc->flags, pe_rsc_orphan)) {
         offset += snprintf(buffer + offset, LINE_MAX - offset, " ORPHANED ");
     }
-    offset += snprintf(buffer + offset, LINE_MAX - offset, "%s ", role2text(rsc->role));
+    if(rsc->role > RSC_ROLE_SLAVE && is_set(rsc->flags, pe_rsc_failed)) {
+        offset += snprintf(buffer + offset, LINE_MAX - offset, "FAILED %s ", role2text(rsc->role));
+    } else if(is_set(rsc->flags, pe_rsc_failed)) {
+        offset += snprintf(buffer + offset, LINE_MAX - offset, "FAILED ");
+    } else {
+        offset += snprintf(buffer + offset, LINE_MAX - offset, "%s ", role2text(rsc->role));
+    }
+
     if(node) {
         offset += snprintf(buffer + offset, LINE_MAX - offset, "%s ", node->details->uname);
     }
     if(is_not_set(rsc->flags, pe_rsc_managed)) {
         offset += snprintf(buffer + offset, LINE_MAX - offset, "(unmanaged) ");
     }
-    if(is_set(rsc->flags, pe_rsc_failed)) {
-        offset += snprintf(buffer + offset, LINE_MAX - offset, "FAILED ");
-    }
     if(is_set(rsc->flags, pe_rsc_failure_ignored)) {
         offset += snprintf(buffer + offset, LINE_MAX - offset, "(failure ignored)");
     }