[Horizon] Limit css fixup to Ubuntu package 35/51735/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 5 Feb 2018 21:35:21 +0000 (22:35 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 5 Feb 2018 23:45:07 +0000 (00:45 +0100)
Horizon package from Mirantis mcp-repos does not require the fixup,
so limit its application to non-mcp packages.
Required for upcoming NOVCP scenarios, where we also have mcp-repos
APT source on the proxy nodes.

JIRA: FUEL-324
JIRA: FUEL-310

Change-Id: I4399af803c0a17e0aa8f3d7a7330e501a5eedf55
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/config/states/openstack_ha

index 0bbf7cd..a035a8b 100755 (executable)
@@ -65,15 +65,17 @@ 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
+# workaround for Ubuntu Pike Horizon missing css, FUEL-324
+if ! salt -C 'I@horizon:server and *01*' --out=yaml pkg.version openstack-dashboard | grep -qE 'mcp'; then
+  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
+fi
 
 clstr_vip_addr=$(salt -C 'I@nginx:server and *01*' --out=yaml \
   pillar.get _param:cluster_vip_address | awk '{print $2; exit}')