Bug 459256

Summary: While provisioning a system, filtering of kickstart profiles doesn't work as expected
Product: [Community] Spacewalk Reporter: Miroslav Suchý <msuchy>
Component: WebUIAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.6CC: bbuckingham, cperry, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-17 07:00:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456550    

Description Miroslav Suchý 2008-08-15 13:03:27 UTC
+++ This bug was initially created as a clone of Bug #426786 +++

--- Additional comment from tao on 2007-12-26 06:22:38 EDT ---

Description of problem:
The "Filter by Kickstart Profile" under provisioning tab of system doesn't work. on RHN Satellite 5.0.1

For more details refer Steps to Reproduce section mentioned below.

How reproducible:
Always

Steps to Reproduce:

Create a couple of kickstart profiles with names as
repro-1786760
reproduce-1765948
test-reproduce1
rhel4reproduce
rhel5testrepro

Select a system with Provisioning entitlement.

Click on Provisioning -> 

Under "Filter by Kickstart Profile: " 
Enter repro - this would display only
repro-1786760
reproduce-1765948


Actual results:
repro-1786760
reproduce-1765948

Expected results:
repro-1786760
reproduce-1765948
test-reproduce1
rhel4reproduce
rhel5testrepro


Let me know if any other details are required.

Thanks !
Paresh

--- Additional comment from tao on 2007-12-26 06:22:39 EDT ---

Hello Paresh,

This seems to be a bug, looking at the List filtering code it seems that
we check the start of the string with the specified prefix.

The following patch should correct the behavior:

--- frontend/taglibs/helpers/ListViewHelper.java.patch  2007-06-21
02:31:40.000000000 +0530
+++ frontend/taglibs/helpers/ListViewHelper.java        2007-12-26
16:27:36.000000000 +0530
@@ -195,7 +195,7 @@
         for (Iterator iter = this.result.iterator(); iter.hasNext();) {
             Map row = (Map) iter.next();
             String value = (String) row.get(this.filterByField);
-            if (value != null && value.startsWith(filterValue)) {
+            if (value != null && value.contentEquals(filterValue)) {
                 accum.add(row);
             }
         }

Comment 1 Miroslav Suchý 2008-08-15 13:07:21 UTC
Commited to git as a043e005792492a25e5bf5b4a4646cbd8859b0b2

Comment 2 Brad Buckingham 2008-09-08 19:04:35 UTC
Verified in Spacewalk 0.2

Comment 3 Miroslav Suchý 2009-09-17 07:00:09 UTC
Spacewalk is released for long time.