Unhandled UnboundLocalError in IPAssociationWorkflow

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

Bug Description

If an error is raised in the AssociateIPAction 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 two problem spots are in AssociateIPAction.populate_ip_id_choices (https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py#L68) and AssociateIPAction. populate_instance_id_choices (https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py#L84)

If the error handler doesn't raise a redirect, control will be returned to the statement after the 'except' block but some of the necessary variables may be unbound.

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

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

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

commit e686fb8520a1a2ea87bc70689af7fd262160e982
Author: Brian DeHamer <email address hidden>
Date: Tue Mar 11 08:40:12 2014 -0700

    Fix unbound locals in IPAssociationWorkflow

    If an error is raised in the AssociateIPAction 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 all of the necessary locals are bound in
    the event that an error does occur.

    Change-Id: Ib8c92ab218457e51e521d36bb4778c1dc1025342
    Closes-Bug: #1290583

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
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.