image-list returns empty when upgrading to new v1.0.0 client

Bug #1492887 reported by Sam Morrison
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Critical
Unassigned

Bug Description

I upgraded to the new v1.0.0 python-glanceclient and now doing a

glance image-list returns nothing.

Doing a glance image-show on a know ID works.

glance --version
1.0.0

curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}XXXXXXXXX' -H 'Content-Type: application/octet-stream' http://glance:9292/v2/images?limit=20&sort=name:asc

HTTP/1.1 200 OK
date: Mon, 07 Sep 2015 04:36:59 GMT
connection: keep-alive
content-type: application/json; charset=UTF-8
content-length: 94
x-openstack-request-id: req-ddad486c-f310-4ceb-8c3d-248fe9acde79

{"images": [], "schema": "/v2/schemas/images", "first": "/v2/images?sort=name%3Aasc&limit=20"}

+----+------+
| ID | Name |
+----+------+
+----+------+

If I pass in --os-image-api-version 1 it works

If I use an older client and specify --os-image-api-version 2 it works also

Revision history for this message
Jake Yip (waipengyip) wrote :

Hi Sam,

I believe the problem is with v1.0.0 against a juno glance-registry.

I have a review over at https://review.openstack.org/#/c/221234/, can you see if that solves the problem?

Revision history for this message
Sam Morrison (sorrison) wrote :

Yeah that review fixes this issue

tags: added: 1.0.0-potential
Tom Fifield (fifieldt)
tags: added: ops
Changed in python-glanceclient:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/221234
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=c8c8964ddd5a49de6eb4794fba68ab4ec0400b08
Submitter: Jenkins
Branch: master

commit c8c8964ddd5a49de6eb4794fba68ab4ec0400b08
Author: Jake Yip <email address hidden>
Date: Tue Sep 8 20:04:11 2015 +1000

    Updates default --sort behaviour

    When querying against a Juno glance-registry, we found that having the
    --sort option defaulting to 'name:asc" results in querying the registry
    with additional SQL parameters like the following:

    WHERE image_properties_2.name = :name_1 AND image_properties_2.value =
    :value_1

    as a result of handling the newer 'sort' filter. This results in a
    blank list being returned as the output of glance image-list.

    This patch sets the --sort-key and --sort-dir instead of --sort when
    neither --sort-key nor --sort-dir are specified, so as to maintain
    backwards compatibility with Juno glance-registry.

    Change-Id: I8bd64cca7f1b7abdbabf4c09e3dbbcb4044e51b4
    Closes-bug: #1492887

Changed in python-glanceclient:
status: New → Fix Committed
Changed in python-glanceclient:
milestone: none → 1.1.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.