Bug 499869 - ipa hostgroup-find returns 0 on error
ipa hostgroup-find returns 0 on error
Status: CLOSED ERRATA
Product: freeIPA
Classification: Community
Component: ipa-admintools (Show other bugs)
2.0
All Linux
low Severity low
: ---
: ---
Assigned To: Rob Crittenden
Chandrasekar Kannan
:
Depends On:
Blocks: 431020
  Show dependency treegraph
 
Reported: 2009-05-08 12:52 EDT by Jenny Galipeau
Modified: 2015-01-04 18:38 EST (History)
4 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-27 03:13:52 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-08 12:52:33 EDT
Description of problem:

If you execute some of the ipa hostgroup-find command defining a host group that doesn't exist,  returns 0 instead of 161 as expected.  TET automation results below:

520|0 2 21735 1 1|START hostgrpcli_010: Negative - Host Group Doesn't Exist
520|0 2 21735 1 2|ipa hostgroup-del returned expected code trying to delete a host group that doesn't exist.
520|0 2 21735 1 3|ERROR - unexpected return code from ipa hostgroup-find.  expected: 161 got: 0
520|0 2 21735 1 4|ipa hostgroup-show returned expected code trying to show a host group that doesn't exist.
520|0 2 21735 1 5|ipa hostgroup-mod returned expected code trying to modify a host group that doesn't exist.
520|0 2 21735 1 6|ipa hostgroup-add-member returned expected code trying to adding member to a host group that doesn't exist.
520|0 2 21735 1 7|ipa hostgroup-remove-member returned expected code trying to removing a member from a host group that doesn't exist.


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

How reproducible:
always

Steps to Reproduce:
1. ipa hostgroup-find groupdoesntexist
2.
3.
  
Actual results:
All commands to return 161 
ipa: ERROR: entry not found

Expected results:
hostgroup-find and hostgroup-mod return 0
No entries found

Additional info:
Comment 1 Jenny Galipeau 2009-05-08 12:54:08 EDT
(In reply to comment #0)
> Description of problem:
> 
> If you execute some of the ipa hostgroup-find command defining a host group
> that doesn't exist,  returns 0 instead of 161 as expected.  TET automation
> results below:
> 
> 520|0 2 21735 1 1|START hostgrpcli_010: Negative - Host Group Doesn't Exist
> 520|0 2 21735 1 2|ipa hostgroup-del returned expected code trying to delete a
> host group that doesn't exist.
> 520|0 2 21735 1 3|ERROR - unexpected return code from ipa hostgroup-find. 
> expected: 161 got: 0
> 520|0 2 21735 1 4|ipa hostgroup-show returned expected code trying to show a
> host group that doesn't exist.
> 520|0 2 21735 1 5|ipa hostgroup-mod returned expected code trying to modify a
> host group that doesn't exist.
> 520|0 2 21735 1 6|ipa hostgroup-add-member returned expected code trying to
> adding member to a host group that doesn't exist.
> 520|0 2 21735 1 7|ipa hostgroup-remove-member returned expected code trying to
> removing a member from a host group that doesn't exist.
> 
> 
> Version-Release number of selected component (if applicable):
> 2.0
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. ipa hostgroup-find groupdoesntexist
> 2.
> 3.
> 
> Actual results:
> All commands to return 161 
> ipa: ERROR: entry not found
> 
> Expected results:
> returns 0
> No entries found
> 
> Additional info:
Comment 2 Pavel Zuna 2009-11-23 08:05:16 EST
"entry not found" isn't reported; the command says "0 hostgroups were matched"; exit code is non-zero

master: 322d8238a0862355340e1ad9a464bd40f6e9b728
All-around improvements to baseldap.py classes.
Comment 3 Jenny Galipeau 2011-06-10 14:20:15 EDT
verified

Different now but acceptable

# ipa hostgroup-find badgroup
--------------------
0 hostgroups matched
--------------------
----------------------------
Number of entries returned 0
----------------------------
[root@dhcp-100-19-202 data]# echo $?
1

# rpm -qi ipa-server | head
Name        : ipa-server                   Relocations: (not relocatable)
Version     : 2.0.0                             Vendor: Red Hat, Inc.
Release     : 23.el6                        Build Date: Wed 20 Apr 2011 09:57:13 AM EDT
Install Date: Thu 19 May 2011 12:47:52 PM EDT      Build Host: x86-003.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: ipa-2.0.0-23.el6.src.rpm
Size        : 2565882                          License: GPLv3+
Signature   : RSA/8, Thu 21 Apr 2011 03:48:25 PM EDT, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.freeipa.org/
Summary     : The IPA authentication server

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