From 5e6d5d3233c27e7912182d8ff71ea19f2ba5939e Mon Sep 17 00:00:00 2001 From: Alexey Deryugin Date: Fri, 2 Sep 2016 14:37:10 +0300 Subject: [PATCH] Change the way Murano dashboard collects static with UCA packages Horizon UCA packages collects static during installation and doesn't recollect it if we use '--clear' option. It leads to static absesnce. So we need to delete '--clear' option for Murano dashboard collectstatic script when we use UCA packages Change-Id: I9719208dff88ce4f3be1b038b8bb6a49a6ec387f Related-Bug: #1603528 --- manifests/dashboard.pp | 8 +++++++- spec/classes/murano_dashboard_spec.rb | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/manifests/dashboard.pp b/manifests/dashboard.pp index d6bbbee..1ce87d9 100644 --- a/manifests/dashboard.pp +++ b/manifests/dashboard.pp @@ -91,8 +91,14 @@ class murano::dashboard( path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ], } + if $::os_package_type == 'ubuntu' { + $collect_static_command = "${collect_static_script} collectstatic --noinput" + } else { + $collect_static_command = "${collect_static_script} collectstatic --noinput --clear" + } + exec { 'django_collectstatic': - command => "${collect_static_script} collectstatic --noinput --clear", + command => $collect_static_command, environment => [ "APACHE_USER=${::apache::params::user}", "APACHE_GROUP=${::apache::params::group}", diff --git a/spec/classes/murano_dashboard_spec.rb b/spec/classes/murano_dashboard_spec.rb index 5530950..d376421 100644 --- a/spec/classes/murano_dashboard_spec.rb +++ b/spec/classes/murano_dashboard_spec.rb @@ -7,6 +7,14 @@ describe 'murano::dashboard' do end shared_examples_for 'with default class parameters' do + let(:collect_static_command) { + if facts[:os_package_type] == 'ubuntu' + "/usr/share/openstack-dashboard/manage.py collectstatic --noinput" + else + "/usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear" + end + } + it { is_expected.to contain_package('murano-dashboard').with({ :ensure => 'present', :name => 'python-murano-dashboard', @@ -39,7 +47,7 @@ describe 'murano::dashboard' do })} it { is_expected.to contain_exec('django_collectstatic').with({ - :command => '/usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear' + :command => collect_static_command })} it { is_expected.to contain_exec('django_compressstatic').with({ @@ -64,6 +72,14 @@ describe 'murano::dashboard' do } end + let(:collect_static_command) { + if facts[:os_package_type] == 'ubuntu' + "/bin/openstack-dashboard/manage.py collectstatic --noinput" + else + "/bin/openstack-dashboard/manage.py collectstatic --noinput --clear" + end + } + it { is_expected.to contain_package('murano-dashboard').with({ :ensure => 'present', :name => 'python-murano-dashboard', @@ -95,7 +111,7 @@ describe 'murano::dashboard' do })} it { is_expected.to contain_exec('django_collectstatic').with({ - :command => '/bin/openstack-dashboard/manage.py collectstatic --noinput --clear' + :command => collect_static_command })} it { is_expected.to contain_exec('django_compressstatic').with({