Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1392422

Summary: Searches on on parameters with "!=" does not work as expected.
Product: Red Hat Satellite Reporter: Tomer Brisker <tbrisker>
Component: SearchAssignee: Dominik Hlavac Duran <dhlavacd>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: high Docs Contact:
Priority: high    
Version: NightlyCC: bbuckingham, bkearney, jcallaha, kelly.brown1, mhulan, mmccune, mtaru, oshtaier, pwaghmar, sabnave, sjagtap, szadok, xdmoon, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.11.0.78-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1463806 (view as bug list) Environment:
Last Closed: 2017-08-10 17:02:29 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:
Attachments:
Description Flags
EL6 Hotfix
none
EL7 Hotfix
none
MD5 Sums for EL6
none
MD5 Sums for EL7 none

Description Tomer Brisker 2016-11-07 13:24:42 UTC
Description of problem:
Host parameters search does not return expected results when using the "!=" operator.

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

How reproducible:
always

Steps to Reproduce:
1. Create a global parameter 'myparam' with value "1".
2. Override the parameter on one host with value "2".
3. Search for hosts matching "params.myparam != 0"

Actual results:
Only the overriden host is displayed.

Expected results:
All hosts are displayed.

Additional info:

Comment 2 Shlomi Zadok 2017-01-04 09:26:15 UTC
Is https://bugzilla.redhat.com/show_bug.cgi?id=1269021 a duplicate of this issue?

Comment 3 Tomer Brisker 2017-01-04 09:39:01 UTC
@shlomi - I don't think so, this one has to do with the custom method used to search on parameters, I don't think the same one is used for package names.

Comment 4 Tomer Brisker 2017-01-04 09:43:13 UTC
Note for anyone hitting this issue - this could be worked around by using 'not' in the search which works correctly, i.e. in the example above, "not params.myparam = 0" will return the correct result.

Comment 5 Satellite Program 2017-01-05 16:08:38 UTC
Upstream bug assigned to dhlavacd

Comment 6 Satellite Program 2017-02-23 17:13:52 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17272 has been resolved.

Comment 15 Zach Huntington-Meath 2017-05-24 20:09:14 UTC
HOTFIX INSTRUCTIONS - Specifically for: SATELLITE 6.2.9

Install instructions: 
  
1) Download the attached tar for your appropriate version.

2) Extract files xvf Foreman_Hotfix_BZ1392422_el*.tar.bz2

3) Stop services with katello-service stop

4) CD into the unzipped folder and yum localinstall *

5) Start services with katello-service start

I have attached a text file with the MD5 sums of all the contents of the tar files to check against.

Comment 16 Zach Huntington-Meath 2017-05-24 20:10:01 UTC
Created attachment 1282068 [details]
EL6 Hotfix

Comment 17 Zach Huntington-Meath 2017-05-24 20:10:41 UTC
Created attachment 1282069 [details]
EL7 Hotfix

Comment 18 Zach Huntington-Meath 2017-05-24 20:11:10 UTC
Created attachment 1282070 [details]
MD5 Sums for EL6

Comment 19 Zach Huntington-Meath 2017-05-24 20:12:10 UTC
Created attachment 1282071 [details]
MD5 Sums for EL7

Comment 24 Sanket Jagtap 2017-07-24 11:31:15 UTC
Build: Satellite 6.2.11 snap1



hammer> host list --search "params.myparam = 1"
---|-----------------------------------------------------|------------------|------------|------------|------------------
ID | NAME                                                | OPERATING SYSTEM | HOST GROUP | IP         | MAC
---|-----------------------------------------------------|------------------|------------|------------|------------------
2  | apple.satellite.com                 | RedHat 7.3       |            | 0.0.0.2 | 00:1a:4a:3e:a6:2f
3  | mango.satellite.com                 | RedHat 7.3       |            | 0.0.0.4 | 00:1a:4a:3e:a6:3f
4  | pineapple.satellite.com             | RedHat 7.3       |            | 0.0.0.6 | 00:1a:4a:3e:a6:33
1  | qe-sat6-feature-rhel7.satellite.com | RedHat 7.3       |            | 0.0.0.1 | 52:54:00:32:9e:c6
---|-----------------------------------------------------|------------------|------------|------------|------------------
hammer> host set-parameter --host-id 2 --name myparam --value=2
New host parameter created
hammer> host set-parameter --host-id 4 --name myparam --value=2
New host parameter created
hammer> host list --search "params.myparam = 1"
---|-----------------------------------------------------|------------------|------------|------------|------------------
ID | NAME                                                | OPERATING SYSTEM | HOST GROUP | IP         | MAC
---|-----------------------------------------------------|------------------|------------|------------|------------------
3  | mango.satellite.com                 | RedHat 7.3       |            | 0.0.0.4 | 00:1a:4a:3e:a6:3f
1  | qe-sat6-feature-rhel7.satellite.com | RedHat 7.3       |            | 0.0.0.1 | 52:54:00:32:9e:c6
---|-----------------------------------------------------|------------------|------------|------------|------------------
hammer> host list --search "params.myparam != 0"
---|-----------------------------------------------------|------------------|------------|------------|------------------
ID | NAME                                                | OPERATING SYSTEM | HOST GROUP | IP         | MAC
---|-----------------------------------------------------|------------------|------------|------------|------------------
2  | apple.satellite.com                 | RedHat 7.3       |            | 0.0.0.2 | 00:1a:4a:3e:a6:2f
3  | mango.satellite.com                 | RedHat 7.3       |            | 0.0.0.4 | 00:1a:4a:3e:a6:3f
4  | pineapple.satellite.com             | RedHat 7.3       |            | 0.0.0.6 | 00:1a:4a:3e:a6:33
1  | qe-sat6-feature-rhel7.satellite.com | RedHat 7.3       |            | 0.0.0.1 | 52:54:00:32:9e:c6
---|-----------------------------------------------------|------------------|------------|------------|------------------

Comment 27 errata-xmlrpc 2017-08-10 17:02:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2466