Skip to content
Snippets Groups Projects
Name Last commit Last update
garr
README.md
local_settings.py

Openstack Dashboard GARR theme

References

Prerequisites

  1. add company logo, background images etc in the garr/img/ folder.
  2. edit 'garr/_styles.scss' and add the correct paths ( eg -> background-image: url("/static/themes/garr/img/GarrCloud.png") ) to the logo and other images in the css.
  3. edit 'local_settings.py' with the right theme name (in this case the folder that contains the theme is called 'garr', so add 'garr' in local_settings.py).

Usage

  1. juju config dashboard-test ubuntu-theme=no
  2. cd openstack-dashboard-garr-theme; tar -cvzf garr-theme.tgz garr local_settings.py;
  3. juju attach-resource dashboard-test theme=garr-theme.tgz
  4. juju config dashboard-test custom-theme=true
  5. juju ssh dashboard-test/0; python3 /usr/share/openstack-dashboard/manage.py collectstatic; python3 /usr/share/openstack-dashboard/manage.py compress --force;

Clarifications

Workaround for custom images rendering

If we run the commands 1-4 described in the Usage section without the last command, the custom theme injection works but images (such the garr logo etc) are not rendered.

This behaviour is caused by the following bug: https://bugs.launchpad.net/charm-openstack-dashboard/+bug/1897805.

The issue is that the theme is correctly unpacked at '/usr/share/openstack-dashboard/openstack_dashboard/themes/custom' but does not show up at '/var/lib/openstack-dashboard/static/themes'. Horizon searches '/var/lib/openstack-dashboard/static/themes/garr/img' in order to render the garr custom theme images (such as company logo etc.). If the folder does not exists, obviously it can't render images because it doesn't find them.

As a workaround for this issue we need to execute command 5 from the Usage section. After that, the theme correctly appears at '/var/lib/openstack-dashboard/static/themes' and images are rendered.

local_settings.py can be altered with theme injection

As stated here (https://github.com/openstack/charm-openstack-dashboard/blob/master/README.md#custom-theme), if the file 'local_settings.py' is included in the theme folder it will be sourced. The changes does not appear in the '/etc/openstack-dashboard/local_settings.py' file but they are enforced nontheless. The changes appear in the '/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.d/custom_theme.py' file.