Blame SOURCES/bz1122818-02-fix-resource-relocate-for-remote-nodes.patch

71541a
From 5f6b6c657f2a88985baf02d24a2de8dafa8ec736 Mon Sep 17 00:00:00 2001
71541a
From: Tomas Jelinek <tojeline@redhat.com>
71541a
Date: Tue, 25 Aug 2015 13:08:46 +0200
71541a
Subject: [PATCH] fix resource relocate for remote nodes
71541a
71541a
---
71541a
 pcs/test/test_utils.py     |  69 +++++++++++++++++++++++++++
71541a
 pcs/test/transitions02.xml | 116 +++++++++++++++++++++++++++++++++++++++++++++
71541a
 pcs/utils.py               |   8 ++--
71541a
 3 files changed, 190 insertions(+), 3 deletions(-)
71541a
 create mode 100644 pcs/test/transitions02.xml
71541a
71541a
diff --git a/pcs/utils.py b/pcs/utils.py
71541a
index 740ff04..cd33a27 100644
71541a
--- a/pcs/utils.py
71541a
+++ b/pcs/utils.py
71541a
@@ -2014,7 +2014,9 @@ def simulate_cib(cib_dom):
71541a
 
71541a
 def get_operations_from_transitions(transitions_dom):
71541a
     operation_list = []
71541a
-    watched_operations = ("start", "stop", "promote", "demote")
71541a
+    watched_operations = (
71541a
+        "start", "stop", "promote", "demote", "migrate_from", "migrate_to"
71541a
+    )
71541a
     for rsc_op in transitions_dom.getElementsByTagName("rsc_op"):
71541a
         primitives = rsc_op.getElementsByTagName("primitive")
71541a
         if not primitives:
71541a
@@ -2040,7 +2042,7 @@ def get_resources_location_from_operations(cib_dom, resources_operations):
71541a
     locations = {}
71541a
     for res_op in resources_operations:
71541a
         operation = res_op["operation"]
71541a
-        if operation not in ("start", "promote"):
71541a
+        if operation not in ("start", "promote", "migrate_from"):
71541a
             continue
71541a
         long_id = res_op["long_id"]
71541a
         if long_id not in locations:
71541a
@@ -2061,7 +2063,7 @@ def get_resources_location_from_operations(cib_dom, resources_operations):
71541a
                 "long_id": long_id,
71541a
                 "id_for_constraint": id_for_constraint,
71541a
             }
71541a
-        if operation == "start":
71541a
+        if operation in ("start", "migrate_from"):
71541a
             locations[long_id]["start_on_node"] = res_op["on_node"]
71541a
         if operation == "promote":
71541a
             locations[long_id]["promote_on_node"] = res_op["on_node"]
71541a
-- 
71541a
1.9.1
71541a