From 766cc54a50b7a2854f15e7af9d65c97a8b5e6b14 Mon Sep 17 00:00:00 2001 From: Samuel Cassiba Date: Mon, 6 Mar 2017 15:59:28 -0800 Subject: [PATCH] Corrects SELinux enablement, lbaasv2 dashboard installation - corrects SELinux enablement on RHEL platform families. - switches lbaasv2 dashboard to use system Python, so that it gets picked up correctly. Change-Id: I8b10381b169e8dd56c9cee990f1e3c7d3283d1b0 --- recipes/apache2-server.rb | 2 +- recipes/horizon.rb | 2 +- recipes/neutron-lbaas-dashboard.rb | 9 +++++++-- spec/neutron-lbaas-dashboard_spec.rb | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/recipes/apache2-server.rb b/recipes/apache2-server.rb index d473c9a..10d4c69 100644 --- a/recipes/apache2-server.rb +++ b/recipes/apache2-server.rb @@ -194,7 +194,7 @@ apache_site 'openstack-dashboard' do end execute 'restore-selinux-context' do - command 'restorecon -Rv /etc/httpd /etc/pki; chcon -R -t httpd_sys_content_t /usr/share/openstack-dashboard || :' + command 'restorecon -Rv /etc/httpd /etc/pki; chcon -R -t httpd_sys_content_t /usr/share/openstack-dashboard /var/www/html || :' action :nothing only_if { platform_family?('fedora') } end diff --git a/recipes/horizon.rb b/recipes/horizon.rb index 7a31b62..b7384f0 100644 --- a/recipes/horizon.rb +++ b/recipes/horizon.rb @@ -115,7 +115,7 @@ package 'openstack-dashboard-ubuntu-theme' do end # resource can be triggered from other recipes (e.g. in -# recipe/neutron-lbaas-dashboard.rb) +# recipes/neutron-lbaas-dashboard.rb) execute 'openstack-dashboard collectstatic' do cwd django_path environment 'PYTHONPATH' => "/etc/openstack-dashboard:#{django_path}:$PYTHONPATH" diff --git a/recipes/neutron-lbaas-dashboard.rb b/recipes/neutron-lbaas-dashboard.rb index 2e9bb31..373c55a 100644 --- a/recipes/neutron-lbaas-dashboard.rb +++ b/recipes/neutron-lbaas-dashboard.rb @@ -17,12 +17,17 @@ include_recipe 'openstack-dashboard::horizon' -python_runtime '2' - django_path = node['openstack']['dashboard']['django_path'] +# use system python for lbaasv2 dashboard +python_runtime 'neutron-lbaas-dashboard' do + provider :system + version '2.7' +end + python_package 'neutron-lbaas-dashboard' do version node['openstack']['dashboard']['lbaas']['version'] + notifies :run, 'execute[restore-selinux-context]', :immediately notifies :run, 'execute[openstack-dashboard collectstatic]' end diff --git a/spec/neutron-lbaas-dashboard_spec.rb b/spec/neutron-lbaas-dashboard_spec.rb index b6a8a2f..7982dfd 100644 --- a/spec/neutron-lbaas-dashboard_spec.rb +++ b/spec/neutron-lbaas-dashboard_spec.rb @@ -17,7 +17,7 @@ describe 'openstack-dashboard::neutron-lbaas-dashboard' do end it do - expect(chef_run).to install_python_runtime('2') + expect(chef_run).to install_python_runtime('neutron-lbaas-dashboard') end it do