Bug #3024
openSort order columns
Description
It affects to the section "Facts". If I go there and try to sort my machines using for example the fact "uptime_days", foreman sorts using only the first digit of the value. For example: a machine with 113 of uptime for foreman it's a lower value than a machine with a 2 days uptime. Show the column "Value" in the attached image for a better explanation.
I´m using theforeman version: 1.2.2
Files
Updated by David LeVene almost 10 years ago
A "workaround" for this is to use the hammer api & sort function provided by Unix.
- hammer fact list --search uptime_days --per-page 250 | sort -nr -k3,3 -t"|"
The sorting is happening like it is a "word", if you remove the -n - it sorts the way foreman does. The fix for this issue would be to confirm if all the facts are a numeric number - or perhaps a more long term approach is to have a new (?) column in the database which defines what kind of search is applied to a fact.