Bug 1341582

Summary: When setting operation default fails the returns code is 0 instead of 1
Product: Red Hat Enterprise Linux 7 Reporter: Sofer Athlan-Guyot <sathlang>
Component: pcsAssignee: Ivan Devat <idevat>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.4CC: 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: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:37:49 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 Flags
additional fix none

Description Sofer Athlan-Guyot 2016-06-01 10:17:33 UTC
Description of problem:

When setting operation default, if there is an error, then the pcs command has a zero return code instead of non-zero.  Then, it's difficult to catch error in scripts, in my particular case, the pcs puppet provider.

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

0.9.143

How reproducible: Always

Steps to Reproduce:

# /sbin/pcs resource op defaults timeouts 200s
Invalid Property: timeouts
Invalid Property: 200s

Actual results:

# echo $?
0


Expected results:
# echo $?
1

Comment 6 Ivan Devat 2017-09-18 11:37:33 UTC
Created attachment 1327333 [details]
additional fix

test:
[vm-rhel72-1 ~] $ pcs resource op defaults timeouts 200s
Error: missing value of 'timeouts' option
[vm-rhel72-1 ~] $ echo $?
1

Comment 7 Ivan Devat 2017-10-11 08:18:58 UTC
After Fix:

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

[vm-rhel72-1 ~] $ pcs resource op defaults timeouts 200s
Error: missing value of 'timeouts' option
[vm-rhel72-1 ~] $ echo $?
1

Comment 12 errata-xmlrpc 2018-04-10 15:37:49 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-2018:0866