TypeError for cinder problems

Bug #1182075 reported by Alexej Ababilov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Alexej Ababilov
Grizzly
Fix Released
Low
Kieran Spear

Bug Description

If cinder does not report correctly, Horizon raises TypeError.

Look at:

    def _get_volumes(self, search_opts=None):
        try:
            return cinder.volume_list(self.request, search_opts=search_opts)
        except:
            exceptions.handle(self.request,
                              _('Unable to retrieve volume list.'))

If an exception is raised, it will return None. Then in openstack_dashboard/dashboards/admin/volumes/views.py we have:

    def get_volumes_data(self):
        volumes = self._get_volumes(search_opts={'all_tenants': 1})
        ...
        for volume in volumes:
            tenant_id = getattr(volume, "os-vol-tenant-attr:tenant_id", None)

and a TypeError will be raised because one cannot iterate through None.

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/29776

Changed in horizon:
assignee: nobody → Alessio Ababilov (aababilov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit decee66cb412cafecddc581cd8f229e77a9c6f1a
Author: Alessio Ababilov <email address hidden>
Date: Mon May 20 16:33:58 2013 +0300

    Always return a list from VolumeTableMixIn._get*

    Returning None from these methods leads to TypeError
    (None is not iterable)

    Fixes: bug #1182075
    Change-Id: Ia5f5fe78669bbaed599b7dd5cae1beb69bde7796

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → havana-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/34666

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/grizzly)

Reviewed: https://review.openstack.org/34666
Committed: http://github.com/openstack/horizon/commit/ef752912b6c604e20872ed961b97ba7e0c32615d
Submitter: Jenkins
Branch: stable/grizzly

commit ef752912b6c604e20872ed961b97ba7e0c32615d
Author: Alessio Ababilov <email address hidden>
Date: Mon May 20 16:33:58 2013 +0300

    Always return a list from VolumeTableMixIn._get*

    Returning None from these methods leads to TypeError
    (None is not iterable)

    Fixes: bug #1182075
    Change-Id: Ia5f5fe78669bbaed599b7dd5cae1beb69bde7796
    (cherry picked from commit decee66cb412cafecddc581cd8f229e77a9c6f1a)

Alan Pevec (apevec)
Changed in horizon:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-1 → 2013.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.