|
|
71541a |
From fedadee0788fc4841bd4b2df03cabd35c57d0f2d Mon Sep 17 00:00:00 2001
|
|
|
71541a |
From: Chris Feist <cfeist@redhat.com>
|
|
|
71541a |
Date: Tue, 6 Oct 2015 15:54:25 -0500
|
|
|
71541a |
Subject: [PATCH] Fixed issue with 'resource manage' not removing meta
|
|
|
71541a |
attribute from clones or masters
|
|
|
71541a |
|
|
|
71541a |
---
|
|
|
71541a |
pcs/resource.py | 8 +++-
|
|
|
71541a |
pcs/test/test_resource.py | 108 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
71541a |
2 files changed, 114 insertions(+), 2 deletions(-)
|
|
|
71541a |
|
|
|
71541a |
diff --git a/pcs/resource.py b/pcs/resource.py
|
|
|
71541a |
index 4c4b8ee..e50e20b 100644
|
|
|
71541a |
--- a/pcs/resource.py
|
|
|
71541a |
+++ b/pcs/resource.py
|
|
|
71541a |
@@ -2349,11 +2349,15 @@ def resource_manage(argv, set_managed):
|
|
|
71541a |
if retval != 0:
|
|
|
71541a |
utils.err("error attempting to unmanage resource: %s" % output)
|
|
|
71541a |
else:
|
|
|
71541a |
- xpath = "(//primitive|//group)[@id='"+resource+"']/meta_attributes/nvpair[@name='is-managed']"
|
|
|
71541a |
+ # Remove the meta attribute from the id specified
|
|
|
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 |
utils.run(["cibadmin", "-D", "--xpath", xpath])
|
|
|
71541a |
if isGroup:
|
|
|
71541a |
for res in res_to_manage:
|
|
|
71541a |
- xpath = "(//primitive|//group)[@id='"+res+"']/meta_attributes/nvpair[@name='is-managed']"
|
|
|
71541a |
+ xpath = "(//primitive|//group|//clone|//master)[@id='"+res+"']/meta_attributes/nvpair[@name='is-managed']"
|
|
|
71541a |
utils.run(["cibadmin", "-D", "--xpath", xpath])
|
|
|
71541a |
|
|
|
71541a |
def is_managed(resource_id):
|