Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1449360

Summary: Improve error message when options in wrong order
Product: Red Hat Enterprise Linux 7 Reporter: Ken Gaillot <kgaillot>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED DUPLICATE QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.3CC: cfeist, cluster-maint, idevat, kgaillot, omular, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-10 06:25:28 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:

Description Ken Gaillot 2017-05-09 19:17:27 UTC
Description of problem: If a user gives pcs options in the wrong order, the resulting error message does not suggest what the problem is.

Version-Release number of selected component (if applicable):


How reproducible: trivially


Steps to Reproduce:
1. pcs resource create res_A ocf:pacemaker:Dummy --clone op monitor interval=30s

Actual results:
Error: When using 'op' you must specify an operation name and at least one option

Expected results:
A more helpful error message

Comment 2 Ivan Devat 2017-05-10 06:02:23 UTC
I tried to run the reproducer but the command worked correctly.

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.157-1.el7.x86_64
[vm-rhel72-1 ~] $ pcs resource create res_A ocf:pacemaker:Dummy --clone op monitor interval=30s
[vm-rhel72-1 ~] $ pcs resource                                                                 
 Clone Set: res_A-clone [res_A]
     Started: [ vm-rhel72-1 vm-rhel72-3 ]

Then I tried to downgrade pcs and I get the expected error:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.143-15.el7.x86_64
[vm-rhel72-1 ~] $ pcs resource create res_B ocf:pacemaker:Dummy --clone op monitor interval=30s
Error: When using 'op' you must specify an operation name and at least one option

Command works correctly with the current upstream as well.

What version of pcs do you use? Can you try upgrade pcs and launch command on it?
The command `pcs resource create` was (relatively) recently overhauled (it should be in the rhel7.4 builds already). So I guess the problem should be only in the older versions of pcs.

Comment 3 Ivan Devat 2017-05-10 06:25:28 UTC
I see that exactly this bug was fixed: bz1395226 (see: Flag --clone steals options of the "op" keyword when "--clone" precedes "op".).
The problem was that pcs lacked the required `op` arguments: name and at least one option. Because flag `--clone` stole it. So the message was correct.

Comment 4 Tomas Jelinek 2017-05-10 08:39:13 UTC

*** This bug has been marked as a duplicate of bug 1395226 ***

Comment 5 Ken Gaillot 2017-05-10 14:28:02 UTC
Whoops, sorry for the noise :-)