Bug 801622 - ipa host-find --in-sudorule does not match hosts in specified sudorule if insertion order is wrong
ipa host-find --in-sudorule does not match hosts in specified sudorule if ins...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Rob Crittenden
Depends On:
  Show dependency treegraph
Reported: 2012-03-08 21:08 EST by Michael Gregg
Modified: 2014-08-05 07:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-13 12:46:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Michael Gregg 2012-03-08 21:08:40 EST
Description of problem:
I add a host to a sudorule, then, I add the host to the system, then searching for that host with ipa host-find --in-sudorule=<sudorule> returns zero results

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

How reproducible:

Steps to Reproduce:
1. kinit as admin
2. ipa sudorule-add srule
3. ipa sudorule-add-host --hosts=h.testrelm.com srule
4. ipa host-add --ip-address= h.testrelm.com
5. ipa host-find --in-sudorule srule
Actual results:
[root@ipaqavmc ipa-host-cli]# ipa host-find --in-sudorule srule
0 hosts matched
Number of entries returned 0

Expected results:
I expect the search to return h.testrelm.com

Additional info:
I am adding the host to the sudorule before the hosts exists. 

searching for the host if it is added to the sudorule in the correct order works properly.
Comment 2 Martin Kosek 2012-03-09 04:17:30 EST
I do not think this is a bug. When you add a host that's not enrolled in IPA, it is considered as an External host and is also stored in a different LDAP attribute (externalHost) than regular IPA hosts (memberHost with DN to IPA host).

If you use the correct order or remove/add your host to srule, it should be added as a standard IPA host and host-find --in-sudorule will work.
Comment 3 Martin Kosek 2012-03-13 12:46:49 EDT
I see no objections, closing as NOTABUG.

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