diff options
author | Radomir Dopieralski <openstack@sheep.art.pl> | 2013-11-15 10:04:31 +0100 |
---|---|---|
committer | Radomir Dopieralski <openstack@sheep.art.pl> | 2013-11-15 10:09:44 +0100 |
commit | b6eb9a2480a82cf93f7a62e9c7373feddc8296fe (patch) | |
tree | df06c2912807dd99301f225d53062d1d32c830b1 /horizon/__init__.py | |
parent | e543879af607aab8b3d6260358964223a0ec677c (diff) | |
download | horizon-b6eb9a2480a82cf93f7a62e9c7373feddc8296fe.tar.gz |
Remove asserts for optional imports
Horizon's __init__.py has some code that explicitly allows it to
be imported by setup.py before Django is set up, by making import
failures just throw a warning instead of an exception. But that code
is defeated by a bunch of asserts that were added later, that just
make the error even more confusing.
I'm removing the asserts and replacing them with __all__.
Closes-bug: #1210253
Change-Id: I0fde7810a033fd7216da9a5460f5e4e323b4d6e9
Diffstat (limited to 'horizon/__init__.py')
-rw-r--r-- | horizon/__init__.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/horizon/__init__.py b/horizon/__init__.py index 67a358e65..865e51bdf 100644 --- a/horizon/__init__.py +++ b/horizon/__init__.py @@ -52,6 +52,17 @@ if Horizon: urls = Horizon._lazy_urls # silence flake8 about unused imports here: -assert Dashboard -assert Panel -assert PanelGroup +__all__ = [ + "Dashboard", + "Horizon", + "Panel", + "PanelGroup", + "register", + "unregister", + "get_absolute_url", + "get_user_home", + "get_dashboard", + "get_default_dashboard", + "get_dashboards", + "urls", +] |