Bug 499464 - ipa hostgroup-add-member: return code 0 even on error
ipa hostgroup-add-member: return code 0 even on error
Status: CLOSED ERRATA
Product: freeIPA
Classification: Community
Component: ipa-admintools (Show other bugs)
2.0
All Linux
medium Severity medium
: v2 release
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks: 431020
  Show dependency treegraph
 
Reported: 2009-05-06 14:39 EDT by Jenny Galipeau
Modified: 2015-01-04 18:38 EST (History)
3 users (show)

See Also:
Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-28 05:29:29 EDT
Type: ---
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 Jenny Galipeau 2009-05-06 14:39:17 EDT
Description of problem:

In this case the host does not exist:

[root@jennyv2 /]# ipa hostgroup-add-member --hosts=jennyv3.bos.redhat.com test
These entries failed to add to the group:
        'jennyv3.bos.redhat.com'
[root@jennyv2 /]# echo $?
0

In this case the host is already a member:

[root@jennyv2 /]# ipa hostgroup-add-member --hosts=jennyv4.bos.redhat.com test
These entries failed to add to the group:
        'cn=jennyv4.bos.redhat.com,cn=computers,cn=accounts,dc=bos,dc=redhat,dc=com'
[root@jennyv2 /]# echo $?
0

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

How reproducible:
always

Steps to Reproduce:
1. add a host 
2. add a host group
3. add the host to the host group
4. test as the above steps
Actual results:
generic error message and return code as if successful.

Expected results:
a better reason as to why the host member was not added and error code returned.

Additional info:
Comment 2 Rob Crittenden 2010-09-21 15:26:14 EDT
https://fedorahosted.org/freeipa/ticket/271
Comment 3 Jenny Galipeau 2010-10-08 10:49:53 EDT
This is marked modified, but does not have any code change / fix associated.  The behavior is still that the utility returns 0 , but outputs that the host in question failed to be added.
Comment 4 Rob Crittenden 2010-10-08 10:57:49 EDT
The update is in the task. I don't believe a new build has been done yet.

It works for me:

$ ipa hostgroup-add-member --hosts=foo hg1
  Host-group: hg1
  Description: hg1
  Failed members: 
    hosts: foo
    hostgroups: 
-------------------------
Number of members added 0
-------------------------
$ echo $?
1

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