← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1489941] Re: v2 client sorts on name in wrong direction

 

It is a bug.

A user, when  they execute:

glance image-list --sort-key name

will reasonably expect that

1) the sort direction is the same as it always has been
2) the names are sorted in alphabetical order


** Changed in: python-glanceclient
       Status: Invalid => New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1489941

Title:
  v2 client sorts on name in wrong direction

Status in Glance:
  Triaged
Status in python-glanceclient:
  New

Bug description:
  
  The v1 client sorts images by name alphabetically:

  
  $ glance --os-image-api-version 1 image-list  --sort-key name 
  +--------------------------------------+---------------------+-------------+------------------+-----------+----------------+
  | ID                                   | Name                | Disk Format | Container Format | Size      | Status         |
  +--------------------------------------+---------------------+-------------+------------------+-----------+----------------+
  | 7d1923d7-68e8-4a8e-b23e-a7c77f8117fd |                     | raw         | bare             | 1034      | active         |
  | 5e9dc64e-7c05-431c-b81f-ae6a212353e8 |                     | qcow2       | bare             |           | queued         |
  | 6802e222-6eac-45c6-8c9f-0d62aed26406 |                     | qcow2       | bare             | 145       | active         |
  | 7af0d66b-5b48-48a6-a6d9-c2cd3eafa83e |                     |             |                  |           | queued         |
  | dde89c3c-c8af-46a4-87b0-f39ed6c61c42 |                     | raw         | bare             | 2         | active         |
  | 262ac5aa-e580-4bec-a3b2-580924425fd5 |                     | raw         | bare             | 2         | active         |
  | 4cc5b305-43a7-495e-8e67-16d95629621e |                     | raw         | bare             | 2         | active         |

  The v2 client sorts in reverse alphabetical:

  $ glance --os-image-api-version 2 image-list  --sort-key name
  +--------------------------------------+---------------------+
  | ID                                   | Name                |
  +--------------------------------------+---------------------+
  | b16dbfb2-f435-40a8-aa08-2aadaee99cd1 | trusty2             |
  | cc658de9-039a-46d7-829a-dc1f08cac153 | test1               |
  | 2fa0f342-623e-423f-8faa-70f000b3e4cc | test1               |
  | c95a4ee7-28d0-4fd5-86c6-fe9816fcef23 | test1               |
  | d75354ed-ef63-4f41-9d53-a0d67394d1a3 | test1               |
  | ecc24d0d-140c-484d-ae42-427e60be9270 | test1               |
  | f3b996a9-469c-4882-864b-fef0cd24429d | test1               |

  
  adding the sort dir gives the same result as v1:

  $ glance --os-image-api-version 2 image-list  --sort-key name --sort-dir asc 
  +--------------------------------------+---------------------+
  | ID                                   | Name                |
  +--------------------------------------+---------------------+
  | 7d1923d7-68e8-4a8e-b23e-a7c77f8117fd |                     |
  | 5e9dc64e-7c05-431c-b81f-ae6a212353e8 |                     |
  | 6802e222-6eac-45c6-8c9f-0d62aed26406 |                     |
  | 7af0d66b-5b48-48a6-a6d9-c2cd3eafa83e |                     |
  | dde89c3c-c8af-46a4-87b0-f39ed6c61c42 |                     |
  | 262ac5aa-e580-4bec-a3b2-580924425fd5 |                     |
  | 4cc5b305-43a7-495e-8e67-16d95629621e |                     |

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1489941/+subscriptions