Fixing get_panel_groups uncaught exception

The get_dashboards method in horizon/base.py returns dashboards
that have been unregistered. Subsequently calling get_panel_groups
on that dashboard causes an uncaught exception.

Fixes: bug#1185914

Change-Id: Ia5a7e7d19e7d2f04731a6840858cd9d9b91cfe00
This commit is contained in:
David Lyle 2013-05-30 11:56:29 -06:00
parent 08f8050d88
commit 5fdc61f576
1 changed files with 5 additions and 4 deletions

View File

@ -411,10 +411,11 @@ class Dashboard(Registry, HorizonComponent):
panel_groups = []
# Gather our known panels
for panel_group in self._panel_groups.values():
for panel in panel_group:
registered.pop(panel.__class__)
panel_groups.append((panel_group.slug, panel_group))
if self._panel_groups is not None:
for panel_group in self._panel_groups.values():
for panel in panel_group:
registered.pop(panel.__class__)
panel_groups.append((panel_group.slug, panel_group))
# Deal with leftovers (such as add-on registrations)
if len(registered):