Horizon: Fix and reload missing css in Pike 15/50915/4
authorting wu <ting.wu@enea.com>
Mon, 22 Jan 2018 09:09:52 +0000 (10:09 +0100)
committerting wu <ting.wu@enea.com>
Tue, 23 Jan 2018 14:47:31 +0000 (15:47 +0100)
The horizon in Pike release is broken due to missing
the static content. This workaround is to:

- create a missing symbolic link.
  The link is defined as an alias in the apache configuraion
- collecting and compressing static assets
- add single "Default" theme as AVAILABLE_THEMES
- restart apache2 service
- apply the workaround to Salt states
 'openstack_ha' and 'openstack_noha'

JIRA: FUEL-324

Change-Id: Idd70165f1be8d31967a3ab518323e6f3e8406624
Signed-off-by: ting wu <ting.wu@enea.com>
mcp/config/states/openstack_ha
mcp/config/states/openstack_noha

index 4948a50..0bbf7cd 100755 (executable)
@@ -65,6 +65,16 @@ salt -I 'ceilometer:agent' state.sls ceilometer
 salt -I 'horizon:server' state.sls horizon
 salt -I 'nginx:server' state.sls nginx,sphinx
 
+# workaround for the pike horizon is missing css, FUEL-324
+salt -I 'horizon:server' file.symlink \
+  /var/lib/openstack-dashboard/static \
+  /usr/share/openstack-dashboard/static
+salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py collectstatic --noinput"
+salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py compress --force"
+salt -I 'horizon:server' file.append /etc/openstack-dashboard/local_settings.py \
+ "AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'),]"
+salt -I 'horizon:server' service.reload apache2
+
 clstr_vip_addr=$(salt -C 'I@nginx:server and *01*' --out=yaml \
   pillar.get _param:cluster_vip_address | awk '{print $2; exit}')
 salt -C 'I@nginx:server and *01*' cp.push \
index bcb7807..9fc30bb 100755 (executable)
@@ -51,3 +51,13 @@ salt -I 'ceilometer:server' state.sls ceilometer
 salt -I 'ceilometer:agent' state.sls ceilometer
 
 salt -I 'horizon:server' state.sls horizon
+
+# workaround for the pike horizon is missing css, FUEL-324
+salt -I 'horizon:server' file.symlink \
+  /var/lib/openstack-dashboard/static \
+  /usr/share/openstack-dashboard/static
+salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py collectstatic --noinput"
+salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py compress --force"
+salt -I 'horizon:server' file.append /etc/openstack-dashboard/local_settings.py \
+  "AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'),]"
+salt -I 'horizon:server' service.reload apache2