Bug 830839

Summary: return code of pcs should match operation's result.
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Kortus <jkortus>
Component: pcsAssignee: Chris Feist <cfeist>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: rsteiger
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 11:04:30 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 Jaroslav Kortus 2012-06-11 13:53:33 UTC
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 22:15:31 UTC
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 11:04:30 UTC
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.