cinder xxx-list subcommands have problems with "--sort key" optional arguments

Bug #1673670 reported by lihaijing on 2017-03-17
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

When you use following cinder subcommands with "--sort <key>" optional argument, there is something wrong in help massages and valid sort-keys you can use.
1.cinder list
2.cinder --os-volume-api-version 3.8 manageable-list
3.cinder --os-volume-api-version 3.8 snapshot-manageable-list
4.cinder --os-volume-api-version 3.5 message-list
5.cinder --os-volume-api-version 3.27 attachment-list
6.cinder backup-list

Such as:
[stack@devstack devstack]$ cinder help snapshot-list
usage: cinder snapshot-list [--all-tenants [<0|1>]] [--name <name>]
                            [--status <status>] [--volume-id <volume-id>]
                            [--marker <marker>] [--limit <limit>]
                            [--sort <key>[:<direction>]] [--tenant [<tenant>]]

Lists all snapshots.

Optional arguments:
  --all-tenants [<0|1>]
                        Shows details for all tenants. Admin only.
  --name <name> Filters results by a name. Default=None.
  --status <status> Filters results by a status. Default=None.
  --volume-id <volume-id>
                        Filters results by a volume ID. Default=None.
  --marker <marker> Begin returning snapshots that appear later in the
                        snapshot list than that represented by this id.
  --limit <limit> Maximum number of snapshots to return. Default=None.
  --sort <key>[:<direction>]
                        Comma-separated list of sort keys and directions in
                        the form of <key>[:<asc|desc>]. Valid keys: id,
                        status, size, availability_zone, name, bootable,
                        created_at, reference. Default=None.
  --tenant [<tenant>] Display information from single tenant (Admin only).

But "size, availability_zone, bootable, reference" sort-keys are not supported.

These subcommands' valid sort-keys are different, but now in python-cinderclient, it just simplely use a SORT_KEY_VALUES in all these list subcommands. In my opinion this is not appropriate.

The patch( ) already fix manageable-list and snapshot-manageable-list subcommands problem. But after that patch merged, I thought about it again. I think use a common way to resolve this problem is better.

lihaijing (lihaijing) on 2017-03-17
Changed in python-cinderclient:
assignee: nobody → lihaijing (lihaijing)

Fix proposed to branch: master

Changed in python-cinderclient:
status: New → In Progress

Change abandoned by Sean McGinnis (<email address hidden>) on branch: master
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Unassigning due to no activity for > 6 months.

Changed in python-cinderclient:
assignee: lihaijing (lihaijing) → nobody
status: In Progress → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers