Useless asserts in __init__ files

Bug #1251546 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

In many __init__.py files in Horizon there is code that looks like this:

from horizon.base import Dashboard # noqa
from horizon.base import Panel # noqa
from horizon.base import PanelGroup # noqa

# silence flake8 about unused imports here:
assert Dashboard
assert Panel
assert PanelGroup

This breaks when the imports are optional, and would be much better done by defining __all__ with the relevant names.

Changed in horizon:
assignee: nobody → Radomir Dopieralski (thesheep)
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/56559

Changed in horizon:
status: New → In Progress
Julie Pichon (jpichon)
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/56559
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=66419fef503b63821afc05238d08fdbe21b49c83
Submitter: Jenkins
Branch: master

commit 66419fef503b63821afc05238d08fdbe21b49c83
Author: Radomir Dopieralski <email address hidden>
Date: Fri Nov 15 10:37:10 2013 +0100

    Replace asserts in __init__ files with __all__

    Defines __all__ in place of assert statements in the __init__.py files.

    Change-Id: I0e871789d012e3ec579a8563a61d7ae32e20ed96
    Closes-bug: #1251546

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