Blame SOURCES/bz902407-pcmk-pe_location_constraints_with_role_started_should_prevent_masters_from_running_at_all.patch

ed0026
commit fbb822a3f83a180380d16be59d8eb9e38abbdce3
ed0026
Author: Andrew Beekhof <andrew@beekhof.net>
ed0026
Date:   Tue Oct 1 15:20:25 2013 +1000
ed0026
ed0026
    Fix: PE: Location constraints with role=Started should prevent masters from running at all
ed0026
    
ed0026
    (cherry picked from commit b4c34e06f5f355f5cf6ee721b4bff1ce455e114e)
ed0026
ed0026
diff --git a/pengine/constraints.c b/pengine/constraints.c
ed0026
index 9fc52d9..594d630 100644
ed0026
--- a/pengine/constraints.c
ed0026
+++ b/pengine/constraints.c
ed0026
@@ -402,13 +402,17 @@ unpack_rsc_location(xmlNode * xml_obj, pe_working_set_t * data_set)
ed0026
             return FALSE;
ed0026
 
ed0026
         } else {
ed0026
-            location->role_filter = text2role(role);
ed0026
-            if (location->role_filter == RSC_ROLE_SLAVE) {
ed0026
-                /* Fold slave back into Started for simplicity
ed0026
-                 * At the point Slave location constraints are evaluated,
ed0026
-                 * all resources are still either stopped or started
ed0026
-                 */
ed0026
-                location->role_filter = RSC_ROLE_STARTED;
ed0026
+            enum rsc_role_e r = text2role(role);
ed0026
+            switch(r) {
ed0026
+                case RSC_ROLE_UNKNOWN:
ed0026
+                case RSC_ROLE_STARTED:
ed0026
+                case RSC_ROLE_SLAVE:
ed0026
+                    /* Applies to all */
ed0026
+                    location->role_filter = RSC_ROLE_UNKNOWN;
ed0026
+                    break;
ed0026
+                default:
ed0026
+                    location->role_filter = r;
ed0026
+                    break;
ed0026
             }
ed0026
         }
ed0026
     }