diff --git a/openstack_dashboard/utils/settings.py b/openstack_dashboard/utils/settings.py index 8f7487329e..65b26c4295 100644 --- a/openstack_dashboard/utils/settings.py +++ b/openstack_dashboard/utils/settings.py @@ -48,7 +48,10 @@ def import_dashboard_config(modules): elif (hasattr(submodule, 'PANEL') or hasattr(submodule, 'PANEL_GROUP') or hasattr(submodule, 'FEATURE')): - config[submodule.__name__] = submodule.__dict__ + # If enabled and local.enabled contains a same filename, + # the file loaded later (i.e., local.enabled) will be used. + name = submodule.__name__.rsplit('.', 1)[1] + config[name] = submodule.__dict__ else: logging.warning("Skipping %s because it doesn't have DASHBOARD" ", PANEL, PANEL_GROUP, or FEATURE defined.", diff --git a/releasenotes/notes/plugin-enabled-override-f317e7c9c352f58f.yaml b/releasenotes/notes/plugin-enabled-override-f317e7c9c352f58f.yaml new file mode 100644 index 0000000000..5e3afcc0ac --- /dev/null +++ b/releasenotes/notes/plugin-enabled-override-f317e7c9c352f58f.yaml @@ -0,0 +1,21 @@ +--- +upgrade: + - | + [:bug:`1700325`] Horizon now allows to override an embeded default plugin + enabled file by specifying an enabled plguin file with a same filename. + If there are plugin enabled files with a same name both in ``enabled`` and + ``local/enabled`` directories, the file in ``local/enabled`` will be used + and the file in ``enabled`` will be ignored now. + Previously, both files are processed in the order of ``enabled`` and then + ``local/enabled`` in this case, but this made operators difficult to change + the order of panels from the default order. + + This is useful when you would like to disable some default panel. + You can do it by specifying ``DISABLED = True`` in a plugin enabled file + in ``local/enabled`` directory with a same name. + + This works in most cases, but there is a case where you need to be careful + when upgrading horizon. If you use ``REMOVE_PANEL`` to remove some default + panel by putting a plugin enabled file with a same name in + ``local/enabled`` directory, you now need to use ``DISABLED = True`` or + change the filename.