Allow local/enabled panels to order relative to enabled panels

A dashboard enabled file in local/enabled is not able to appear before,
or inbetween any core panels.

The list of panels appears to be intended to be sorted by file name,
but all files in /enabled and always presented in the nav ahead of
any files from local/enabled, no matter the file name.

This appears to be a bug in util/settings.py that does an rsplit to
separate file name from path, but accidentally uses the full list of
split items, instead of just the file name.

For example, a file with __name__ of
'openstack_dashboard.enabled._1040_project_volumes_panel' splits into
['openstack_dashboard.enabled', '_1040_project_volumes_panel']. When
this list is fed to cmp(), it will always come before a panel in
local/enabled such as
['openstack_dashboard.local.enabled', '_0001_my_new_panel']

Change-Id: Ic169ccf0db1e04ec42fe999df6648117ce9efe84
Closes-Bug: 1567047
This commit is contained in:
Tyr Johanson 2016-04-06 13:36:05 -06:00
parent 7f6942f478
commit ea92e73582
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ def import_dashboard_config(modules):
", PANEL, PANEL_GROUP, or FEATURE defined.",
submodule.__name__)
return sorted(six.iteritems(config),
key=lambda c: c[1]['__name__'].rsplit('.', 1))
key=lambda c: c[1]['__name__'].rsplit('.', 1)[1])
def update_dashboards(modules, horizon_config, installed_apps):