Bug 1443418
Summary: | pcs should allow to specify id of resource operations and validate them | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Tomas Jelinek <tojeline> | ||||
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 7.4 | CC: | cfeist, cluster-maint, idevat, omular, rsteiger, tojeline | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | pcs-0.9.160-1.el7 | Doc Type: | Bug Fix | ||||
Doc Text: |
Cause:
user enters an invalid resource operation id
Consequence:
pcs exits with an error and dumps an invalid CIB to the terminal
Fix:
pcs validates resource operation id
Result:
pcs gracefully exits with an error explaining the id is not valid
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2018-04-10 15:39:15 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Tomas Jelinek
2017-04-19 08:38:25 UTC
Created attachment 1289976 [details]
proposed fix + test
pcs now validates resource operation id and its uniqueness.
affected commands:
* pcs resource create
* pcs resource update
* pcs resource op add
After Fix: [vm-rhel72-1 ~] $ rpm -q pcs pcs-0.9.160-1.el7.x86_64 > create [vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor interval=30 id=X [vm-rhel72-1 ~] $ pcs cluster cib --config | grep 'id="R"' -A4 <primitive class="ocf" id="R" provider="heartbeat" type="Dummy"> <operations> <op id="X" interval="30" name="monitor"/> </operations> </primitive> [vm-rhel72-1 ~] $ pcs resource create R2 ocf:heartbeat:Dummy op monitor interval=30 id=X Error: 'X' already exists [vm-rhel72-1 ~] $ pcs resource create R2 ocf:heartbeat:Dummy op monitor interval=30 id=#X Error: invalid operation id '#X', '#' is not a valid first character for a operation id [vm-rhel72-1 ~] $ pcs resource create R2 ocf:heartbeat:Dummy op monitor interval=30 id=Y op monitor interval=60 id=Y Error: 'Y' already exists > op add [vm-rhel72-1 ~] $ pcs resource op add R start timeout=30 id=Y [vm-rhel72-1 ~] $ pcs cluster cib --config | grep 'id="R"' -A5 <primitive class="ocf" id="R" provider="heartbeat" type="Dummy"> <operations> <op id="X" interval="30" name="monitor"/> <op id="Y" interval="0s" name="start" timeout="30"/> </operations> </primitive> [vm-rhel72-1 ~] $ pcs resource op add R start timeout=30 id=Y Error: id 'Y' is already in use, please specify another one [vm-rhel72-1 ~] $ pcs resource op add R start timeout=30 id=#Y Error: invalid operation id '#Y', '#' is not a valid first character for a operation id > update [vm-rhel72-1 ~] $ pcs resource update R op start timeout=40 id=R Error: id 'R' is already in use, please specify another one [vm-rhel72-1 ~] $ pcs resource update R op start timeout=40 id=#Y Error: invalid operation id '#Y', '#' is not a valid first character for a operation id Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0866 |