horizon/horizon
Janet Yu 6b9f019959 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)
(cherry picked from commit 5c1604275b)
2015-06-18 18:12:02 +02:00
..
browsers Fix Flake8 style warnings in horizon/ 2014-07-29 20:38:49 +00:00
conf Remove #noqa from two common imports and add them to import_exceptions 2014-09-16 14:08:28 +04:00
contrib Datepicker locale support 2014-09-23 14:24:48 +00:00
forms Fix E127 errors in horizon/ 2014-10-01 19:49:41 +09:00
locale Translation update for Juno 2014.2.3 2015-04-04 01:14:43 +09:00
management Fixed several typos in comments 2014-05-24 14:42:14 -05:00
static/horizon Fix exponentially growing AJAX updates for table rows 2015-04-30 22:11:16 +00:00
tables Fix E127 errors in horizon/ 2014-10-01 19:49:41 +09:00
tabs Remove NotImplementedErrors from "virtual" methods 2014-09-02 11:31:05 +02:00
templates Sanitation of metadata passed from Django 2015-05-15 14:21:31 -05:00
templatetags Merge "Fix dynamic select layout when help block is displayed" into stable/juno 2015-03-30 21:10:01 +00:00
test Remove selenium dependency when not using selenium tests 2014-10-25 22:30:57 +09:00
utils Fixes session timeout string in horizon 2014-09-24 10:23:40 +05:30
workflows Fix E127 errors in horizon/ 2014-10-01 19:49:41 +09: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-06-18 18:12:02 +02: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 Merge "Replace force_unicode with force_text" 2014-08-08 00:18:38 +00:00
loaders.py Always split template names on forward slash 2014-09-23 11:38:34 +03: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-09 15:11:58 +00:00
models.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
site_urls.py Remove #noqa from two common imports and add them to import_exceptions 2014-09-16 14:08:28 +04:00
version.py Remove extraneous vim configuration comments 2014-05-06 15:30:10 +08:00
views.py Remove NotImplementedErrors from "virtual" methods 2014-09-02 11:31:05 +02:00