Bug 1417453 - 'sort_key' does not work for 'name' param on v2 snapshot API GET Edit
Summary: 'sort_key' does not work for 'name' param on v2 snapshot API GET Edit
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 12.0 (Pike)
Assignee: Eric Harney
QA Contact: Tzach Shefi
Depends On:
TreeView+ depends on / blocked
Reported: 2017-01-29 14:46 UTC by lkuchlan
Modified: 2017-04-11 18:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-04-11 18:56:10 UTC
Target Upstream Version:
scohen: needinfo+

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Launchpad 1659504 0 None None None 2017-01-29 14:46:13 UTC
OpenStack gerrit 431488 0 None None None 2017-04-11 18:56:10 UTC

Description lkuchlan 2017-01-29 14:46:13 UTC
Description of problem:

v2 snapshots POST/GET/PUT all works with 'name' in request as well as in response. But only sort things does not work on 'name' it expect only 'display_name'.

Seems like DB layer have only 'display_name' no 'name').

It is little bit odd where 'name' is being published everywhere on API and user does not know what 'display_name' is in v2 APIs but user is being force to sort with 'display_name' only and 'name' sort_key does not work. This seems odd APIs behavior.

All other APIs and filter etc translation logic to convert 'name' to 'display_name' is there- https://github.com/openstack/cinder/blob/master/cinder/api/v2/snapshots.py#L92

For sort also same should be done at least.

Ref- https://review.openstack.org/#/c/421251/

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create several snapshots from volume.
2. cinder --debug snapshot-list --sort name:asc

Actual results:

REQ: curl -g -i -X GET <-----

RESP BODY: {"snapshots": [{"status": "available", "description": null, "updated_at": "2017-01-29T14:14:26.000000", "volume_id": "af409fd7-3a3c-41de-9dbf-176e0a58034e", "id": "f7ce9c71-ef83-4df6-a024-967516f7c872", "size": 1, "os-extended-snapshot-attributes:progress": "100%", "name": "snap-a", <----

Comment 1 Eric Harney 2017-01-31 21:00:22 UTC
Unable to reproduce -- added notes to upstream bug.

Comment 2 Red Hat Bugzilla Rules Engine 2017-02-01 14:28:22 UTC
This bugzilla has been removed from the release and needs to be reviewed for targeting another release.

Comment 4 Sean Cohen 2017-04-11 18:56:10 UTC
Fix have been proposed upstream [1]
Closing accordingly.

[1] https://review.openstack.org/431488

Note You need to log in before you can comment on or make changes to this bug.