Removing dashboard from HORIZON_CONFIG doesn't work if it's in INSTALLED_APPS

Bug #1056449 reported by Gabriel Hurley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
David Lapsley

Bug Description

The HORIZON_CONFIG "dashboards" setting needs to actively *remove* dashboards that are included in INSTALLED_APPS because the app loading mechanism causes the registration handler to happen regardless.

Changed in horizon:
milestone: none → grizzly-1
Changed in horizon:
milestone: grizzly-1 → grizzly-2
Changed in horizon:
milestone: grizzly-2 → none
Revision history for this message
Maxime Vidori (maxime-vidori) wrote :

What is the meaning of actively remove? Do we have to add a controller which checks INSTALLED_APPS before the registration handler and removes modules from the tuple according to the dashboard attribute of HORIZON_CONFIG?

Revision history for this message
Matthias Runge (mrunge) wrote :

not sure, if HORIZON_CONFIG['dashboards'] is required anymore at all. I just set this to [] and horizon still seems to work for me as expected.

Revision history for this message
David Lapsley (dlapsley) wrote :

Just confirmed you don't. So, horizon.base iterates over INSTALLED_APPS and imports any module that has a 'dashboard' and/or 'panel' sub-module.

Revision history for this message
David Lapsley (dlapsley) wrote :

Hi Folks:

This is not actually a bug, but how the software was designed. The "dashboards" entry in HORIZON_CONFIG was only ever intended to be used in ordering dashboards. Here's the comment from Gabriel in horizon.base.

    def get_dashboards(self):
        """ Returns an ordered tuple of :class:`~horizon.Dashboard` modules.

        Orders dashboards according to the ``"dashboards"`` key in
        ``HORIZON_CONFIG`` or else returns all registered dashboards
        in alphabetical order.

        Any remaining :class:`~horizon.Dashboard` classes registered with
        Horizon but not listed in ``HORIZON_CONFIG['dashboards']``
        will be appended to the end of the list alphabetically.
        """

Revision history for this message
Julie Pichon (jpichon) wrote :

Thanks for looking into it David. Probably the documentation should be updated to make this clearer.

http://docs.openstack.org/developer/horizon/topics/settings.html#dashboards

Revision history for this message
David Lapsley (dlapsley) wrote :

Hi Julie: no problem! I'm happy to have a go at updating the documentation later this week when I have spare time (unless someone else would like to do it).

Cheers, David.

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

Changed in horizon:
assignee: Gabriel Hurley (gabriel-hurley) → David Lapsley (dlapsley)
status: Confirmed → In Progress
Revision history for this message
David Lapsley (dlapsley) wrote :

Hi Julie: I've updated the documentation for this setting and uploaded for review. Let me know if you'd like me to change anything.

Cheers, David.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit 368cf0da6aadb0ade9ad1a22bffc7885c6f854f0
Author: David Lapsley <email address hidden>
Date: Mon Feb 10 19:57:51 2014 -0800

    Update "dashboard" setting documentation

    Updates documentation for the Horizon "dashboard" setting.
    The option works as designed, but is incorrectly documented.

    Change-Id: I4d11528c25ef43f91977321055b3660d144b3c90
    Closes-Bug: 1056449

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.