File bsc#1154881-0001-Fix-scheduler-make-sure-cluster-wide-maintenance-mod.patch of Package pacemaker.14738

From f0fe45806efa8feccc9d1b0f1a92cfb1e547f304 Mon Sep 17 00:00:00 2001
From: Aleksei Burlakov <aleksei.burlakov@suse.com>
Date: Thu, 28 Nov 2019 14:06:11 +0100
Subject: [PATCH] Fix: scheduler: make sure cluster-wide maintenance-mode=true
 overrides per-resource settings

Both primitive and cluster may have maintenance attribute.
When a primitive has is-managed=true, maintenance=false
and the cluster has maintenance-mode=true, the maintenance-mode
wouldn't previously override the is-managed attribute as expected.
---
 lib/pengine/complex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c
index e6b569ee9..5abf2dde1 100644
--- a/lib/pengine/complex.c
+++ b/lib/pengine/complex.c
@@ -530,7 +530,8 @@ common_unpack(xmlNode * xml_obj, resource_t ** rsc,
             set_bit((*rsc)->flags, pe_rsc_maintenance);
         }
 
-    } else if (is_set(data_set->flags, pe_flag_maintenance_mode)) {
+    }
+    if (is_set(data_set->flags, pe_flag_maintenance_mode)) {
         clear_bit((*rsc)->flags, pe_rsc_managed);
         set_bit((*rsc)->flags, pe_rsc_maintenance);
     }
-- 
2.16.4

openSUSE Build Service is sponsored by