Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 897569 Details for
Bug 1099077
resource update on a clone ID returns error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed fix
0001-Fix-pcs-resource-update-for-clones.patch (text/plain), 4.84 KB, created by
Tomas Jelinek
on 2014-05-20 13:00:36 UTC
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Tomas Jelinek
Created:
2014-05-20 13:00:36 UTC
Size:
4.84 KB
patch
obsolete
>From 872adf6d885f4e9c48122070295bad8e1f2dbf12 Mon Sep 17 00:00:00 2001 >From: Tomas Jelinek <tojeline@redhat.com> >Date: Mon, 19 May 2014 16:27:05 +0200 >Subject: [PATCH 1/2] Fix 'pcs resource update' for clones > >--- > pcs/resource.py | 27 +++++++++++++++++++++------ > pcs/test/test_resource.py | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 55 insertions(+), 6 deletions(-) > >diff --git a/pcs/resource.py b/pcs/resource.py >index 09ee5ee..04d9bb0 100644 >--- a/pcs/resource.py >+++ b/pcs/resource.py >@@ -1057,7 +1057,7 @@ def resource_clone_create(argv, update = False, passed_dom = None): > if element == None: > utils.err("unable to find group or resource: %s" % name) > >- if utils.is_resource_clone(name): >+ if utils.is_resource_clone(name) and not update: > utils.err("%s is already a clone resource" % name) > > if utils.is_group_clone(name): >@@ -1070,28 +1070,43 @@ def resource_clone_create(argv, update = False, passed_dom = None): > if element.parentNode.tagName == "group" and element.parentNode.getElementsByTagName("primitive").length <= 1: > element.parentNode.parentNode.removeChild(element.parentNode) > >+ meta = None > if update == True: > if element.parentNode.tagName != "clone": > utils.err("%s is not currently a clone" % name) > clone = element.parentNode >- for ma in clone.getElementsByTagName("meta_attributes"): >- clone.removeChild(ma) >+ for child in clone.childNodes: >+ if ( >+ child.nodeType == child.ELEMENT_NODE >+ and >+ child.tagName == "meta_attributes" >+ ): >+ meta = child >+ break > else: > clone = dom.createElement("clone") > clone.setAttribute("id",name + "-clone") > clone.appendChild(element) > re.appendChild(clone) >+ if meta is None: >+ meta = dom.createElement("meta_attributes") >+ meta.setAttribute("id",name + "-clone-meta") >+ clone.appendChild(meta) > >- meta = dom.createElement("meta_attributes") >- meta.setAttribute("id",name + "-clone-meta") > args = convert_args_to_tuples(argv) > for arg in args: >+ if update: >+ for nvpair in meta.getElementsByTagName("nvpair"): >+ if nvpair.getAttribute("name") == arg[0]: >+ meta.removeChild(nvpair) >+ break >+ if arg[1] == "": >+ continue > nvpair = dom.createElement("nvpair") > nvpair.setAttribute("id", name+"-"+arg[0]) > nvpair.setAttribute("name", arg[0]) > nvpair.setAttribute("value", arg[1]) > meta.appendChild(nvpair) >- clone.appendChild(meta) > > if passed_dom: > return dom >diff --git a/pcs/test/test_resource.py b/pcs/test/test_resource.py >index ec970e8..6ba1b6d 100644 >--- a/pcs/test/test_resource.py >+++ b/pcs/test/test_resource.py >@@ -1298,6 +1298,40 @@ class ResourceTest(unittest.TestCase): > assert returnVal == 0 > assert output == " Clone: dlm-clone\n Meta Attrs: interleave=true clone-node-max=1 ordered=true \n Resource: dlm (class=ocf provider=pacemaker type=controld)\n Operations: monitor interval=10s (dlm-monitor-interval-10s)\n", [output] > >+ def testResourceCloneUpdate(self): >+ o, r = pcs(temp_cib, "resource create --no-default-ops D1 Dummy --clone") >+ assert r == 0 >+ ac(o, "") >+ >+ o, r = pcs(temp_cib, "resource --full") >+ assert r == 0 >+ ac(o, ' Clone: D1-clone\n Resource: D1 (class=ocf provider=heartbeat type=Dummy)\n Operations: monitor interval=60s (D1-monitor-interval-60s)\n') >+ >+ o, r = pcs(temp_cib, 'resource update D1-clone foo=bar') >+ assert r == 0 >+ ac(o, "") >+ >+ o, r = pcs(temp_cib, "resource --full") >+ assert r == 0 >+ ac(o, ' Clone: D1-clone\n Meta Attrs: foo=bar \n Resource: D1 (class=ocf provider=heartbeat type=Dummy)\n Operations: monitor interval=60s (D1-monitor-interval-60s)\n') >+ >+ o, r = pcs(temp_cib, 'resource update D1-clone bar=baz') >+ assert r == 0 >+ ac(o, "") >+ >+ o, r = pcs(temp_cib, "resource --full") >+ assert r == 0 >+ ac(o, ' Clone: D1-clone\n Meta Attrs: foo=bar bar=baz \n Resource: D1 (class=ocf provider=heartbeat type=Dummy)\n Operations: monitor interval=60s (D1-monitor-interval-60s)\n') >+ >+ o, r = pcs(temp_cib, 'resource update D1-clone foo=') >+ assert r == 0 >+ ac(o, "") >+ >+ o, r = pcs(temp_cib, "resource --full") >+ assert r == 0 >+ ac(o, ' Clone: D1-clone\n Meta Attrs: bar=baz \n Resource: D1 (class=ocf provider=heartbeat type=Dummy)\n Operations: monitor interval=60s (D1-monitor-interval-60s)\n') >+ >+ > def testGroupRemoveWithConstraints(self): > o,r = pcs(temp_cib, "resource create --no-default-ops A Dummy --group AG") > assert r == 0 >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1099077
: 897569 |
897570
|
897573