Dashboard#get_panel_group throws KeyError

Bug #1396682 reported by Michael Hagedorn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Michael Hagedorn

Bug Description

In horizon/base.py, calling Dashboard#get_panel_group and passing in a non existent panel, the code blows up with a KeyError. It would make more semantic sense for it to return None.

Tags: panel
Revision history for this message
Michael Hagedorn (mike-hagedorn) wrote :

this is the same kind of thing as 1386826

Revision history for this message
Michael Hagedorn (mike-hagedorn) wrote :

Ok lets try this again: Is very similar to Bug #1386826

Changed in horizon:
assignee: nobody → Michael Hagedorn (mike-hagedorn)
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
milestone: none → kilo-1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/137413
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=754585d67be0673609fac93683f495d8f02aea7c
Submitter: Jenkins
Branch: master

commit 754585d67be0673609fac93683f495d8f02aea7c
Author: Mike Hagedorn <email address hidden>
Date: Wed Nov 26 12:16:22 2014 -0500

    KeyError on getting PanelGroup

    When trying to get a PanelGroup at runtime and
    you specify a nonregistered panel, a KeyError is
    thrown when calling Dashboard.get_panel_group.
    Retrieving values from a Dict using the [] formulation
    results in a KeyError for non existent keys. Using
    Dict#get returns None for non existent keys which is
    what this change does.

    This is relevant to the dynamic panel efforts going on.

    Closes-Bug: 1396682
    Change-Id: I532c3be04fdd229dfd8e01b68320b2eecb6fd866

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
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.