File bug-981489_pacemaker-pengine-shutdown-attribute-remote-node.patch of Package pacemaker.3577

commit 0edc762e63801b92b5a931c10446287f9b3d6406
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Wed Jan 6 15:15:24 2016 +1100

    Feature: PE: Honor the shutdown transient attributes for remote nodes

diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
index 6a125b0..75d9dd8 100644
--- a/lib/pengine/unpack.c
+++ b/lib/pengine/unpack.c
@@ -1145,6 +1145,8 @@ unpack_remote_status(xmlNode * status, pe_working_set_t * data_set)
 {
     const char *id = NULL;
     const char *uname = NULL;
+    const char *shutdown = NULL;
+
     GListPtr gIter = NULL;
 
     xmlNode *state = NULL;
@@ -1190,6 +1192,15 @@ unpack_remote_status(xmlNode * status, pe_working_set_t * data_set)
         attrs = find_xml_node(state, XML_TAG_TRANSIENT_NODEATTRS, FALSE);
         add_node_attrs(attrs, this_node, TRUE, data_set);
 
+        shutdown = g_hash_table_lookup(this_node->details->attrs, XML_CIB_ATTR_SHUTDOWN);
+        if (shutdown != NULL && safe_str_neq("0", shutdown)) {
+            resource_t *rsc = this_node->details->remote_rsc;
+
+            crm_info("Node %s is shutting down", this_node->details->uname);
+            this_node->details->shutdown = TRUE;
+            rsc->next_role = RSC_ROLE_STOPPED;
+        }
+ 
         if (crm_is_true(g_hash_table_lookup(this_node->details->attrs, "standby"))) {
             crm_info("Node %s is in standby-mode", this_node->details->uname);
             this_node->details->standby = TRUE;
openSUSE Build Service is sponsored by