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 :-)