Blob Blame History Raw
commit fbb822a3f83a180380d16be59d8eb9e38abbdce3
Author: Andrew Beekhof <andrew@beekhof.net>
Date:   Tue Oct 1 15:20:25 2013 +1000

    Fix: PE: Location constraints with role=Started should prevent masters from running at all
    
    (cherry picked from commit b4c34e06f5f355f5cf6ee721b4bff1ce455e114e)

diff --git a/pengine/constraints.c b/pengine/constraints.c
index 9fc52d9..594d630 100644
--- a/pengine/constraints.c
+++ b/pengine/constraints.c
@@ -402,13 +402,17 @@ unpack_rsc_location(xmlNode * xml_obj, pe_working_set_t * data_set)
             return FALSE;
 
         } else {
-            location->role_filter = text2role(role);
-            if (location->role_filter == RSC_ROLE_SLAVE) {
-                /* Fold slave back into Started for simplicity
-                 * At the point Slave location constraints are evaluated,
-                 * all resources are still either stopped or started
-                 */
-                location->role_filter = RSC_ROLE_STARTED;
+            enum rsc_role_e r = text2role(role);
+            switch(r) {
+                case RSC_ROLE_UNKNOWN:
+                case RSC_ROLE_STARTED:
+                case RSC_ROLE_SLAVE:
+                    /* Applies to all */
+                    location->role_filter = RSC_ROLE_UNKNOWN;
+                    break;
+                default:
+                    location->role_filter = r;
+                    break;
             }
         }
     }