Bug #26816
closed
Filter by os_minor includes unexpected values
Added by Marek Hulán over 5 years ago.
Updated almost 5 years ago.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1710511
Description of problem:
Filter by os_minor includes unexpected values.
Version-Release number of selected component (if applicable):
How reproducible:
To reproduce:
1. navigate to Hosts => All Hosts
2. enter the following filter: "os_major = 6 and os_minor < 4" and click Search
If version 6.10 is included in the search results, even though 10 is not < than 4.
Notice in the other attached that 6.2 and 6.3 servers are also mentioned, and no 6.4 through 6.9 servers are in the results. However, 6.10 should also not show
Expected: only 6.0, 6.1, 6.2 and 6.3 servers should show
- Subject changed from Filter by os_minor includes unexpected values on the Satellite web UI.
to Filter by os_minor includes unexpected values on the Satellite web UI.
- Category changed from Inventory to Search
- Difficulty set to easy
The reason is that minor version of OS is treated as a string, because it can contain non numerical characters, e.g. 2.1511 in case of CentOS. Therefore we can only compare these value lexically. And 10 is lexically lower than 6, since 1 is earlier in alphabet than 6. For search purposes we could break all numbers apart and store them in DB as integers.
An easy workaround is to query it like "os_major = 6 and os_minor ^ (1,2,3,4)".
- Status changed from New to Assigned
- Assignee set to yifat makias
- Pull request https://github.com/theforeman/foreman/pull/7056 added
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/7065 added
- Fixed in Releases 2.0.0 added
- Status changed from Ready For Testing to Closed
- Subject changed from Filter by os_minor includes unexpected values on the Satellite web UI. to Filter by os_minor includes unexpected values
Also available in: Atom
PDF