API wrappers swallow AttributeError inside @properties

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

Bug Description

If an AttributeError gets rised inside a @property on an APIResourceWrapper or APIDictWrapper, we will get its "not found" error, even when the original error was from a completely different object. The reason for that is in how __getattr__ works in Python and how any AttributeError from a property gets interpreted as "no such attribute, call __getattr__" by that mechanism.

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

Changed in horizon:
assignee: nobody → Radomir Dopieralski (thesheep)
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Low
milestone: none → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit 20b414db2fcb3863ad37e3e3fc88d264acdc9f32
Author: Radomir Dopieralski <email address hidden>
Date: Wed Jan 29 14:06:46 2014 +0100

    Don't lose AttributeError in API Wrappers

    Instead of (implicitly) catching the AttributeError, and later
    creating and raising a new one, we just re-raise the original
    exception. This way all the information from the original is
    retained, including the name of the actual object on which it
    happened.

    Change-Id: Idc0c5a8ed5dfca6a8724e393c220baf9960564ed
    Closes-bug: #1274097

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: icehouse-3 → 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.