The openstack_dashboard.utils.settings ModuleΒΆ

openstack_dashboard.utils.settings.find_static_files(HORIZON_CONFIG, AVAILABLE_THEMES, THEME_COLLECTION_DIR, ROOT_PATH)[source]
openstack_dashboard.utils.settings.get_xstatic_dirs(XSTATIC_MODULES, HORIZON_CONFIG)[source]

Discover static file configuration of the xstatic modules.

For each entry in the XSTATIC_MODULES list we determine the entry point files (which may come from the xstatic MAIN var) and then determine where in the Django static tree the xstatic package’s contents should be placed.

For jquery.bootstrap.wizard.js the module name is None the static file is actually a 3rd-party file but resides in the Horizon source tree and not an xstatic package.

The xstatic.pkg.jquery_ui package had its contents moved by packagers so it must be handled as a special case.

openstack_dashboard.utils.settings.import_dashboard_config(modules)[source]

Imports configuration from all the modules and merges it.

openstack_dashboard.utils.settings.import_submodules(module)[source]

Import all submodules and make them available in a dict.

openstack_dashboard.utils.settings.update_dashboards(modules, horizon_config, installed_apps)[source]

Imports dashboard and panel configuration from modules and applies it.

The submodules from specified modules are imported, and the configuration for the specific dashboards is merged, with the later modules overriding settings from the former. Then the configuration is applied to horizon_config and installed_apps, in alphabetical order of files from which the configurations were imported.

For example, given this setup:

foo/__init__.py
foo/_10_baz.py
foo/_20_qux.py
bar/__init__.py
bar/_30_baz_.py

and being called with modules=[foo, bar], we will first have the configuration from _10_baz and _30_baz merged, then the configurations will be applied in order qux, baz (baz is second, because the most recent file which contributed to it, _30_baz, comes after _20_qux).

Panel specific configurations are stored in horizon_config. Dashboards from both plugin-based and openstack_dashboard must be registered before the panel configuration can be applied. Making changes to the panel is deferred until the horizon autodiscover is completed, configurations are applied in alphabetical order of files where it was imported.

Previous topic

The openstack_dashboard.utils Module

Next topic

The openstack_dashboard.utils.filters Module

Project Source

This Page