Images table broken due to recent glanceclient change

Bug #1027210 reported by Mark McLoughlin
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Tihomir Trifonov

Bug Description

Since this glanceclient change:

  https://review.openstack.org/#/c/9816/

the images table is broken. I don't have the error to hand but the issue is here:

def image_list_detailed(...):
    ...
    images = glanceclient(request).images.list(...)
    if(len(images) > limit):
    ....

The return from images.list() is no longer a list, it is a generator, so you get:

  TypeError: object of type 'generator' has no len()

Revision history for this message
Paul Maunders (sq2d3bipy0t2o-paul) wrote :

I've just installed the latest version of devstack, and I'm also seeing this error.

TypeError at /syspanel/images/images/
object of type 'generator' has no len()
Request Method: GET
Request URL: http://192.168.0.24/syspanel/images/images/
Django Version: 1.4
Exception Type: TypeError
Exception Value:
object of type 'generator' has no len()
Exception Location: /opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/api/glance.py in image_list_detailed, line 63
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:
['/opt/stack/horizon/openstack_dashboard/wsgi/../..',
 '/opt/stack/python-keystoneclient',
 '/usr/local/lib/python2.7/dist-packages',
 '/opt/stack/python-novaclient',
 '/opt/stack/python-openstackclient',
 '/opt/stack/keystone',
 '/opt/stack/glance',
 '/opt/stack/python-glanceclient',
 '/opt/stack/nova',
 '/opt/stack/horizon',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/pymodules/python2.7',
 '/opt/stack/horizon/openstack_dashboard']
Server time: Fri, 20 Jul 2012 15:56:35 -0500

Revision history for this message
star99 (star99) wrote :

I installed the latest version of devstack ,and meet this issues,too.

Changed in horizon:
status: New → Confirmed
Changed in horizon:
assignee: nobody → Tihomir Trifonov (ttrifonov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/10122

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/10122
Committed: http://github.com/openstack/horizon/commit/dec4876e2414dc48052ad95939081cc183bfef54
Submitter: Jenkins
Branch: master

commit dec4876e2414dc48052ad95939081cc183bfef54
Author: Tihomir Trifonov <email address hidden>
Date: Mon Jul 23 13:24:55 2012 +0300

    Fixed the bug with images returned as generator

    After a fix in Glance to support pagination,
    the list of images is returned as generator,
    while api.glance expects a list.

    PATCHSET 2: removed optional kwargs if None
    PATCHSET 3: fixed snapshot_list_detailed.

    Fixed bug 1027210

    Change-Id: I1c68e3625c22e591776e83c742e7b94dc893f196

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Gabriel Hurley (gabriel-hurley) wrote :

This is actually a bigger problem that we need to reconcile... devstack is using the clients from github, while horizon is using the stable clients from PyPI. Opening a separate issue to track.

Thierry Carrez (ttx)
Changed in horizon:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: folsom-3 → 2012.2
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.