File pacemaker-libpe_status-log-startup-fencing-value.patch of Package pacemaker.openSUSE_Leap_42.3_Update

commit 9caae1f540a248d5ebd95dc097664778c96dee60
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Tue Sep 26 12:28:51 2017 -0500

    Log: libpe_status: always log startup-fencing value
    
    This also refactors to make startup-fencing a data set flag,
    which is more consistent, readable and efficient.

Index: pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/status.h
===================================================================
--- pacemaker-1.1.16+20170320.77ea74d.orig/include/crm/pengine/status.h
+++ pacemaker-1.1.16+20170320.77ea74d/include/crm/pengine/status.h
@@ -71,6 +71,7 @@ enum pe_find {
 
 #  define pe_flag_start_failure_fatal	0x00001000ULL
 #  define pe_flag_remove_after_stop	0x00002000ULL
+#  define pe_flag_startup_fencing       0x00004000ULL
 
 #  define pe_flag_startup_probes	0x00010000ULL
 #  define pe_flag_have_status		0x00020000ULL
Index: pacemaker-1.1.16+20170320.77ea74d/lib/pengine/unpack.c
===================================================================
--- pacemaker-1.1.16+20170320.77ea74d.orig/lib/pengine/unpack.c
+++ pacemaker-1.1.16+20170320.77ea74d/lib/pengine/unpack.c
@@ -295,6 +295,15 @@ unpack_config(xmlNode * config, pe_worki
               is_set(data_set->flags,
                      pe_flag_start_failure_fatal) ? "always fatal" : "handled by failcount");
 
+    if (is_set(data_set->flags, pe_flag_stonith_enabled)) {
+        set_config_flag(data_set, "startup-fencing", pe_flag_startup_fencing);
+    }
+    if (is_set(data_set->flags, pe_flag_startup_fencing)) {
+        crm_trace("Unseen nodes will be fenced");
+    } else {
+        pe_warn_once(pe_wo_blind, "Blind faith: not fencing unseen nodes");
+    }
+
     node_score_red = char2score(pe_pref(data_set->config_hash, "node-health-red"));
     node_score_green = char2score(pe_pref(data_set->config_hash, "node-health-green"));
     node_score_yellow = char2score(pe_pref(data_set->config_hash, "node-health-yellow"));
@@ -524,9 +533,6 @@ expand_remote_rsc_meta(xmlNode *xml_obj,
 static void
 handle_startup_fencing(pe_working_set_t *data_set, node_t *new_node)
 {
-    static const char *blind_faith = NULL;
-    static gboolean unseen_are_unclean = TRUE;
-
     if ((new_node->details->type == node_remote) && (new_node->details->remote_rsc == NULL)) {
         /* Ignore fencing for remote nodes that don't have a connection resource
          * associated with them. This happens when remote node entries get left
@@ -535,23 +541,13 @@ handle_startup_fencing(pe_working_set_t
         return;
     }
 
-    blind_faith = pe_pref(data_set->config_hash, "startup-fencing");
-
-    if (crm_is_true(blind_faith) == FALSE) {
-        unseen_are_unclean = FALSE;
-        pe_warn_once(pe_wo_blind, "Blind faith: not fencing unseen nodes");
-    }
-
-    if (is_set(data_set->flags, pe_flag_stonith_enabled) == FALSE
-        || unseen_are_unclean == FALSE) {
-        /* blind faith... */
-        new_node->details->unclean = FALSE;
+    if (is_set(data_set->flags, pe_flag_startup_fencing)) {
+        // All nodes are unclean until we've seen their status entry
+        new_node->details->unclean = TRUE;
 
     } else {
-        /* all nodes are unclean until we've seen their
-         * status entry
-         */
-        new_node->details->unclean = TRUE;
+        // Blind faith ...
+        new_node->details->unclean = FALSE;
     }
 
     /* We need to be able to determine if a node's status section
openSUSE Build Service is sponsored by