Bug 830839 - return code of pcs should match operation's result.
return code of pcs should match operation's result.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Chris Feist
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-11 09:53 EDT by Jaroslav Kortus
Modified: 2014-06-17 19:56 EDT (History)
1 user (show)

See Also:
Fixed In Version: pcs-0.9.5-4.el7.noarch
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 07:04:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jaroslav Kortus 2012-06-11 09:53:33 EDT
Description of problem:
return code of pcs should match operation's result.

$ pcs stonith create virt-fencing fence_xvm pcmk_host_check="static-list" pcmk_host_list="r7-node01,r7-node02,r7-node03" action="reboot" debug="1"
ERROR: Unable to create resource/fence device
Call cib_create failed (-21): The object already exists
<failed>
  <failed_update id="virt-fencing" object_type="primitive" operation="cib_create" reason="The object already exists">
    <primitive class="stonith" id="virt-fencing" type="fence_xvm">
      <instance_attributes id="virt-fencing-instance_attributes">
        <nvpair id="virt-fencing-instance_attributes-pcmk_host_check" name="pcmk_host_check" value="static-list"/>
        <nvpair id="virt-fencing-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="r7-node01,r7-node02,r7-node03"/>
        <nvpair id="virt-fencing-instance_attributes-action" name="action" value="reboot"/>
        <nvpair id="virt-fencing-instance_attributes-debug" name="debug" value="1"/>
      </instance_attributes>
    </primitive>
  </failed_update>
</failed>

(08:50:50) [root@r7-node01:~]$ echo $?
0


Version-Release number of selected component (if applicable):
pcs-0.9.3.1-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. run the fencing setup command twice (to get resource id conflict)
2.
3.
  
Actual results:
conflict reported, exit code = 0

Expected results:
conflict reported, exit code > 0

Additional info:
Comment 1 Chris Feist 2012-06-11 18:15:31 EDT
Before fix:

[root@rh7-2 ~]# pcs stonith create virt-fencing fence_xvm pcmk_host_check="static-list" pcmk_host_list="r7-node01,r7-node02,r7-node03" action="reboot" debug="1"
[root@rh7-2 ~]# echo $?
0
[root@rh7-2 ~]# pcs stonith create virt-fencing fence_xvm pcmk_host_check="static-list" pcmk_host_list="r7-node01,r7-node02,r7-node03" action="reboot" debug="1"
ERROR: Unable to create resource/fence device
[root@rh7-2 ~]# echo $?
0

After fix:

[root@rh7-1 pcs]# pcs stonith create virt-fencing fence_xvm pcmk_host_check="static-list" pcmk_host_list="r7-node01,r7-node02,r7-node03" action="reboot" debug="1"
[root@rh7-1 pcs]# echo $?
0
[root@rh7-1 pcs]# pcs stonith create virt-fencing fence_xvm pcmk_host_check="static-list" pcmk_host_list="r7-node01,r7-node02,r7-node03" action="reboot" debug="1"
ERROR: Unable to create resource/fence device
Call cib_create failed (-21): The object already exists
[root@rh7-1 pcs]# echo $?
1
Comment 5 Ludek Smid 2014-06-13 07:04:30 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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