e2ef492311
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 |
||
---|---|---|
.. | ||
static/plugin_panel | ||
templates/plugin_panel | ||
__init__.py | ||
panel.py | ||
urls.py | ||
views.py |