Unhandled UnboundLocalError in instance DetailView

Bug #1291021 reported by Brian DeHamer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Brian DeHamer

Bug Description

If an error is raised in the DetailView in openstack_dashboard.dashboards.project.instances.views) we assume that a redirect will be raised. However, certain exception classes will not result in a redirect when handled by the standard Horizon exception handler.

The problem spot is here (https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/instances/views.py#L270). If the error handler doesn't raise a redirect, control will be returned to the statement after the 'except' block and the 'instance' variable may be unbound.

description: updated
summary: - Unhandled UnboundLocalError in instance views
+ Unhandled UnboundLocalError in instance DetailView
Changed in horizon:
assignee: nobody → Brian DeHamer (brian-dehamer)
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/79755

Changed in horizon:
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit f680b741e205ecf883e2761873cc2c9e4043f896
Author: Brian DeHamer <email address hidden>
Date: Sat Feb 22 01:07:46 2014 -0800

    Fix unbound local error in instance DetailView

    If an error is raised in the instance DetailView we assume that a
    redirect will be raised. However, certain exception classes will not
    result in a redirect when handled by the standard Horizon exception
    handler. If the error handler doesn't re-raise some sort of error,
    control will be returned to the statement after the except block and
    some of the necessary local variables may be unbound.

    This fix simply ensures that an errors result in a redirect so that
    we never end-up in a situation where the instance variable is unbound.

    Change-Id: Ica9a09c9236bb50206277425633d63a8e7387401
    Closes-Bug: 1291021

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-rc1 → 2014.1
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.