horizon/horizon
Janet Yu 5c1604275b Fix addition of plugin panel to panel group
Revert fix from bug #1329050, which adds a plugin panel to its dashboard's
class. Adding a plugin panel to a dashboard whose class has its panels defined
in a tuple will fail because the new plugin cannot be appended to the tuple.
The code errors out before the panel gets added to the dashboard's panel list.
However, at this point, the panel has already been registered with the
dashboard. This causes Dashboard.get_panels() to see the panel in its registry
but not in its panel groups. Consequently, the panel gets put in the "Other"
panel group instead of its configured one, as described in bug #1378558.

By not adding the the plugin panel to its dashboard's class, the panel gets
added to its dashboard's panel list. Now the original issue from bug #1329050
resurfaces. The root cause of that is that every time Dashboard._autodiscover()
is called, it instantiates all its panel group classes, wiping out any panels
previously added to any of the panel groups. Avoid this by always processing
all the plugin panel groups before any of the plugin panels, which also ensures
that the panel groups exist before their panels.

Making this change exposed an issue where the Horizon URLs were being loaded
twice during the plugin infrastructure's unit tests, causing plugin panels to
be added multiple times to their dashboards. Fix that by removing the second,
unnecessary call. Also create a second test plugin panel group and panel to
test the scenarios described in the two bugs addressed here, adding two panel
groups at a time.

Change-Id: Id6a99c3ff18102c8f47431638d4dda98f14ec641
Closes-Bug: 1378558
(cherry picked from commit e2ef492311)
2015-04-23 09:37:49 -06:00
..
browsers Fix Flake8 style warnings in horizon/ 2014-07-29 20:38:49 +00:00
conf Revert "Refactoring the exceptions lists" 2015-04-06 16:49:17 -05:00
contrib Datepicker locale support 2014-09-23 14:24:48 +00:00
forms Fix common misspellings 2015-03-23 14:38:32 +01:00
locale Imported Translations from Transifex 2015-04-14 06:17:04 +00:00
management Updating startpanel for pluggables 2015-01-14 16:11:00 -07:00
static Merge "Adding styling for disabled and danger action items" 2015-04-14 01:47:52 +00:00
tables Merge "Change N/A to id in the message" 2015-03-19 11:02:22 +00:00
tabs Merge "Allow to hide tab title bar when only one tab is available" 2015-03-07 00:07:56 +00:00
templates Hide Cancel button if no cancel_url is provided 2015-04-21 13:56:28 +00:00
templatetags Use WEBROOT setting for the 500 page home button 2015-03-30 13:55:28 +01:00
test [Launch Instance Fix] Settings for volume name 2015-04-09 21:00:47 -06:00
utils Merge "Allow all printable ASCII characters in security group names" 2015-03-14 10:07:58 +00:00
workflows Fix setting Primary Project for new user once the project was created 2015-01-16 20:51:31 +03:00
__init__.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
base.py Fix addition of plugin panel to panel group 2015-04-23 09:37:49 -06:00
context_processors.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
decorators.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
exceptions.py Revert "Refactoring the exceptions lists" 2015-04-06 16:49:17 -05:00
loaders.py Add Django-1.7 support 2015-03-18 08:42:10 +01:00
messages.py Uniquify horizon messages returned in a single response 2014-09-17 13:45:07 +00:00
middleware.py Horizon login page contains DOS attack mechanism 2014-12-08 16:38:37 -07:00
models.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
site_urls.py Fix E128 errors in horizon/ 2014-10-15 13:50:07 +09:00
version.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
views.py Document and improve PageTitleMixin readability 2015-02-11 16:16:20 +00:00