Blame SOURCES/bz1122818-01-fix-resource-relocation-of-globally-unique-clones.patch

71541a
From a4fa532d6c1091caf94d64c95c5625738aa1ebf3 Mon Sep 17 00:00:00 2001
71541a
From: Tomas Jelinek <tojeline@redhat.com>
71541a
Date: Wed, 12 Aug 2015 13:36:27 +0200
71541a
Subject: [PATCH] fix resource relocation of globally-unique clones
71541a
71541a
---
71541a
 pcs/test/test_utils.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++---
71541a
 pcs/utils.py           |  9 +++++++-
71541a
 2 files changed, 62 insertions(+), 4 deletions(-)
71541a
71541a
diff --git a/pcs/utils.py b/pcs/utils.py
71541a
index d61ff44..740ff04 100644
71541a
--- a/pcs/utils.py
71541a
+++ b/pcs/utils.py
71541a
@@ -2044,8 +2044,15 @@ def get_resources_location_from_operations(cib_dom, resources_operations):
71541a
             continue
71541a
         long_id = res_op["long_id"]
71541a
         if long_id not in locations:
71541a
+            # Move clone instances as if they were non-cloned resources, it
71541a
+            # really works with current pacemaker (1.1.13-6). Otherwise there
71541a
+            # is probably no way to move them other then setting their
71541a
+            # stickiness to 0.
71541a
+            res_id = res_op["id"]
71541a
+            if ":" in res_id:
71541a
+                res_id = res_id.split(":")[0]
71541a
             id_for_constraint = validate_constraint_resource(
71541a
-                cib_dom, res_op["id"]
71541a
+                cib_dom, res_id
71541a
             )[2]
71541a
             if not id_for_constraint:
71541a
                 continue
71541a
-- 
71541a
1.9.1
71541a