RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1398562 - "resource create" accepts an unknown operation
Summary: "resource create" accepts an unknown operation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Ivan Devat
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-25 09:38 UTC by Ivan Devat
Modified: 2017-08-01 18:24 UTC (History)
6 users (show)

Fixed In Version: pcs-0.9.156-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: The user makes a typo in an operation name when runs "pcs resource create". Pcs silently accept it. Consequence: Pcs puts into the cib a contents than the user intended. Fix: Pcs compares the entered operation name with the list of operation names which is specified in the resource agent. If the name is not found in the list the pcs ends up with an error that could be forced. Result: The user is informed about the potential typo and may decide to either repair or force the command.
Clone Of:
Environment:
Last Closed: 2017-08-01 18:24:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (107.16 KB, patch)
2017-01-31 16:18 UTC, Ivan Devat
no flags Details | Diff
proposed fix (20.38 KB, patch)
2017-01-31 16:21 UTC, Ivan Devat
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1958 0 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Description Ivan Devat 2016-11-25 09:38:12 UTC
Description of problem:
When the user enter an unknown operation (eg. when the user makes a typo) the "resource create" command silently accept it and put it into cib.


How reproducible:
always


Steps to Reproduce:
[vm-rhel72-1 ~] $ pcs resource create A ocf:heartbeat:Dummy op monitro interval=100


Actual results:
No error and there is operation "monitro" in cib (while user expected "monitor").


Expected results:
Error: invalid operation "monitro", valid operations are "monitor", "start", "stop", "promote", "demote" --use force to override
[vm-rhel72-1 ~] $ pcs resource create A ocf:heartbeat:Dummy op monitro interval=100 --force
Warning: invalid operation "monitro", valid operations are "monitor", "start", "stop", "promote", "demote"

Comment 3 Ivan Devat 2017-01-31 16:18:14 UTC
Created attachment 1246358 [details]
proposed fix

Tests are in the patch.

Comment 4 Ivan Devat 2017-01-31 16:21:20 UTC
Created attachment 1246359 [details]
proposed fix

Tests are in the patch.

Comment 5 Ivan Devat 2017-02-20 08:04:11 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64

[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitro interval=100
Error: 'monitro' is not a valid operation name value, use meta-data, migrate_from, migrate_to, monitor, reload, start, stop, validate-all, use --force to override

[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitro interval=100 --force
Warning: 'monitro' is not a valid operation name value, use meta-data, migrate_from, migrate_to, monitor, reload, start, stop, validate-all
[vm-rhel72-1 ~] $ echo $?
0

Comment 9 errata-xmlrpc 2017-08-01 18:24:40 UTC
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-2017:1958


Note You need to log in before you can comment on or make changes to this bug.