add support for sorting project list results

Bug #1596818 reported by Tom on 2016-06-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Wishlist
Tom

Bug Description

keystone tenant-list command return the results ordered by name.
But "openstack project list" default ordered by id, which won't be much user friendly.

It will be nice if openstack project list result default ordered by name.. and the user can also pass as a argument also.

openstack project list --sort id

Tom (tomjosekal) on 2016-06-28
Changed in python-openstackclient:
assignee: nobody → Tom (tomjosekal)
Changed in python-openstackclient:
importance: Undecided → Wishlist
Steve Martinelli (stevemar) wrote :

the server side does not support this, we could do client side ordering, we even have a helper function here: https://github.com/openstack/osc-lib/blob/master/osc_lib/utils.py#L353

the resulting command would be ``openstack project list --sort name[:desc]``

I'd prefer to not have this enabled by default since it would slow things down, it's probably not OSC sorting by ID, but probably keystone itself

Changed in python-openstackclient:
status: New → Triaged
Tom (tomjosekal) wrote :

That is correct keystone client was doing the Order by name...
Server is returning the result ordered by id and Openstack client is just displaying it... Where as keystone is doing a order by name at the client side...FYI (https://github.com/openstack/python-keystoneclient/blob/2.3.1/keystoneclient/v2_0/shell.py#L68&L69)

If we have more than 100 projects it will be difficult to find out the project which we are looking for ...

I working on a fix to introduce ``openstack project list --sort `` and also default it to order by name.. If all disagree with "default order by name" then I can remove it and I can leave with the --sort options....

FYI : I will be using the helper function which is mentioned above...

Steve Martinelli (stevemar) wrote :

Tom, sounds good. Please go ahead and toss up a patch. I'd prefer we do not sort by default for now, it'll impact performance. But we'll see what the other developers say.

Tom (tomjosekal) on 2016-06-28
Changed in python-openstackclient:
status: Triaged → In Progress
summary: - Openstack project list default sorted by id
+ add support for sorting project list results

Reviewed: https://review.openstack.org/335204
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=6c1b03bf7354fe39d61bb9cf93d2491bbb5ebb16
Submitter: Jenkins
Branch: master

commit 6c1b03bf7354fe39d61bb9cf93d2491bbb5ebb16
Author: Tom Jose Kalapura <email address hidden>
Date: Fri Sep 9 22:17:50 2016 -0700

    Add sort support to project list

    Add sort support to project list by sorting items in the client side.
    By default list will be sorted by name.

    Change-Id: I00011406846b4003aff075eeeb88ac18fa5e2820
    Closes-Bug: #1596818

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-openstackclient 3.10.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers