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 1341582 - When setting operation default fails the returns code is 0 instead of 1
Summary: When setting operation default fails the returns code is 0 instead of 1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.4
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-06-01 10:17 UTC by Sofer Athlan-Guyot
Modified: 2018-04-10 15:38 UTC (History)
6 users (show)

Fixed In Version: pcs-0.9.160-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 15:37:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
additional fix (116.82 KB, patch)
2017-09-18 11:37 UTC, Ivan Devat
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0866 0 None None None 2018-04-10 15:38:37 UTC

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


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