Bug #54026
closed
the sort sequence used by 'orch ps' is not in a natural sequence
Added by Paul Cuzner over 2 years ago.
Updated about 2 years ago.
Description
orch ps returns a sequence like this;
osd.987
osd.988
osd.989
osd.99
osd.990
instead of
osd.987
osd.988
osd.989
osd.990
packages like natsort handle sequences like this correctly
- Tags set to low-hanging-fruit
Thanks for reporting. Going with natural sort in general I think it's a good idea and would help the users to read easily the output. My only concern is about the behavior itself as the sorting wouldn't be consistent with other commands (such ash 'orch ls', etc).
I mean if we use natural sorting, shouldn't we use it everywhere for consistency and not only for the 'orch ps' command?
indeed orch ps is special, as it typically lists all the 100's of osds, which is not the case for orch ls. But you're right for host ls and device ls, as users might have more than 11 numerically and sequentially named hosts.
Ok, great. We had a discussion in upstream and we think that it makes more sense to implement the behavior per command since only a subset of commands would benefit from using a natural sorting algorithm. We will start by implementing it for "orch ps" and then extend the support to other commands with similar needs.
- Assignee set to Redouane Kachach Elhichou
- Status changed from New to Fix Under Review
- Pull request ID set to 44895
- Status changed from Fix Under Review to Resolved
Also available in: Atom
PDF