conn.image.images() gets 404 on subsequent pages

Bug #1748534 reported by Daniel Speichert
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack SDK
Confirmed
Undecided
Sidharth Surana

Bug Description

The standard demo snippet for listing images:

    print("List Images:")

    for image in conn.image.images():
        print(image)

is failing when Glance has more than one page to report.

What seems to happen is in here: https://github.com/openstack/python-openstacksdk/blob/0.11.3/openstack/resource.py#L892-L899

the first time, the `uri` variable is `/images` and the `session` (~keystoneauth1.adapter.Adapter) is prepending /v2.

For the second page, the `_get_next_link` function is returning new uri such as:
 `/v2/images?marker=e182ceb2-c752-430c-9ac1-a1cab2e5e0bd`

This results in openstacksdk trying to GET /v2/v2/images?marker=e182ceb2-c752-430c-9ac1-a1cab2e5e0bd
which obviously results in 404.

It could be a bug in keystoneauth1 but probably a workaround in openstacksdk is needed.

Versions:
openstacksdk==0.11.3
Server: Glance Newton / API v2.4

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

Confirmed using 0.12.0, too, against a Pike deployment of Glance.

Changed in python-openstacksdk:
status: New → Confirmed
Revision history for this message
Sidharth Surana (ssurana) wrote :

proposed a fix https://review.openstack.org/#/c/558461 under review for this

Changed in python-openstacksdk:
assignee: nobody → Sidharth Surana (ssurana)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstacksdk 0.13.0

This issue was fixed in the openstack/openstacksdk 0.13.0 release.

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.