Blame SOURCES/bz1268801-Fixes-for-managing-special-cases-of-unmanaged-resour.patch

71541a
From 82f9be59e55c5e5fa01242fb7da59e3610da3674 Mon Sep 17 00:00:00 2001
71541a
From: Chris Feist <cfeist@redhat.com>
71541a
Date: Wed, 7 Oct 2015 09:11:43 -0500
71541a
Subject: [PATCH] Fixes for managing special cases of unmanaged resources
71541a
71541a
---
71541a
 pcs/resource.py | 6 +++---
71541a
 1 file changed, 3 insertions(+), 3 deletions(-)
71541a
71541a
diff --git a/pcs/resource.py b/pcs/resource.py
71541a
index e50e20b..7f2d4c3 100644
71541a
--- a/pcs/resource.py
71541a
+++ b/pcs/resource.py
71541a
@@ -2349,11 +2349,11 @@ def resource_manage(argv, set_managed):
71541a
             if retval != 0:
71541a
                 utils.err("error attempting to unmanage resource: %s" % output)
71541a
         else:
71541a
-            # Remove the meta attribute from the id specified
71541a
-            xpath = "(//primitive|//group|//clone|//master)[@id='"+resource+"']/meta_attributes/nvpair[@name='is-managed']"
71541a
+            # Remove the meta attribute from the id specified (and all children)
71541a
+            xpath = "(//primitive|//group|//clone|//master)[@id='"+resource+"']//meta_attributes/nvpair[@name='is-managed']"
71541a
             utils.run(["cibadmin", "-D", "--xpath", xpath])
71541a
             # Remove the meta attribute from the parent of the id specified, if the parent is a clone or master
71541a
-            xpath = "(//master|//clone)[primitive[contains(@id, '"+resource+"')]]/meta_attributes/nvpair[@name='is-managed']"
71541a
+            xpath = "(//master|//clone)[(group|primitive)[@id='"+resource+"']]/meta_attributes/nvpair[@name='is-managed']"
71541a
             utils.run(["cibadmin", "-D", "--xpath", xpath])
71541a
             if isGroup:
71541a
                 for res in res_to_manage:
71541a
-- 
71541a
2.4.3
71541a