FWaaS Dashboard fix

- FWaaS Dashboard has been moved to a seperate project since Pike
- Minor version bump

Change-Id: I1b734bb8c7394ab227610ead6b69d643f50a7340
This commit is contained in:
Christoph Albers 2018-03-20 15:08:32 +01:00
parent 57b5859831
commit 42d6cd3fe8
5 changed files with 116 additions and 1 deletions

View File

@ -215,6 +215,7 @@ default['openstack']['dashboard']['simple_ip_management'] = false
default['openstack']['dashboard']['neutron']['enable_quotas'] = true
default['openstack']['dashboard']['neutron']['enable_lb'] = false
default['openstack']['dashboard']['neutron']['enable_vpn'] = false
default['openstack']['dashboard']['neutron']['enable_fwaas'] = false
# Allow for misc sections to be added to the local_settings template
# For example: {
# 'CUSTOM_CONFIG_A' => {

View File

@ -4,7 +4,7 @@ maintainer_email 'openstack-dev@lists.openstack.org'
license 'Apache-2.0'
description 'Installs/Configures the OpenStack Dashboard (Horizon)'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '16.0.0'
version '16.1.0'
%w(ubuntu redhat centos).each do |os|
supports os

View File

@ -0,0 +1,53 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-dashboard
# Recipe:: neutron-lbaas-dashboard
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
include_recipe 'openstack-dashboard::horizon'
django_path = node['openstack']['dashboard']['django_path']
policy_file_path = node['openstack']['dashboard']['policy_files_path']
# use system python for fwaas dashboard
python_runtime '2' do
provider :system
version '2.7'
end
python_package 'neutron-fwaas-dashboard'
remote_file "#{django_path}/openstack_dashboard/local/enabled/_7010_project_firewalls_panel.py" do
source 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/pike/neutron_fwaas_dashboard/enabled/_7010_project_firewalls_panel.py'
owner 'root'
mode 0o0644
notifies :run, 'execute[neutron-fwaas-dashboard compilemessages]'
notifies :run, 'execute[openstack-dashboard collectstatic]'
end
remote_file "#{policy_file_path}/neutron-fwaas-policy.json" do
source 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/pike/etc/neutron-fwaas-policy.json'
owner 'root'
mode 0o0644
notifies :run, 'execute[neutron-fwaas-dashboard compilemessages]'
notifies :run, 'execute[openstack-dashboard collectstatic]'
notifies :restart, 'service[apache2]', :delayed
end
execute 'neutron-fwaas-dashboard compilemessages' do
cwd django_path
environment 'PYTHONPATH' => "/etc/openstack-dashboard:#{django_path}:$PYTHONPATH"
command 'python manage.py compilemessages'
action :nothing
end

View File

@ -0,0 +1,60 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-dashboard::neutron-fwaas-dashboard' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
runner.converge(described_recipe)
end
include_context 'non_redhat_stubs'
include_context 'dashboard_stubs'
it do
expect(chef_run).to include_recipe('openstack-dashboard::horizon')
end
it do
expect(chef_run).to install_python_runtime('2')
end
it do
expect(chef_run).to install_python_package('neutron-fwaas-dashboard')
end
it do
expect(chef_run).to create_remote_file(
"#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/_7010_project_firewalls_panel.py"
).with(
mode: 0o0644,
owner: 'root',
source: 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/pike/neutron_fwaas_dashboard/enabled/_7010_project_firewalls_panel.py'
)
end
it do
expect(chef_run.remote_file("#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/_7010_project_firewalls_panel.py"))
.to notify('execute[openstack-dashboard collectstatic]').to(:run)
notify('execute[neutron-fwaas-dashboard compilemessages]').to(:run)
end
it do
expect(chef_run).to create_remote_file(
"#{node['openstack']['dashboard']['policy_files_path']}/neutron-fwaas-policy.json"
).with(
mode: 0o0644,
owner: 'root',
source: 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/pike/etc/neutron-fwaas-policy.json'
)
end
it do
expect(chef_run.remote_file("#{node['openstack']['dashboard']['policy_files_path']}/neutron-fwaas-policy.json"))
.to notify('execute[openstack-dashboard collectstatic]').to(:run)
notify('execute[neutron-fwaas-dashboard compilemessages]').to(:run)
notify('service[apache2]').to(:restart).delayed
end
end
end

View File

@ -228,6 +228,7 @@ OPENSTACK_NEUTRON_NETWORK = {
'enable_lb': <%= node['openstack']['dashboard']['neutron']['enable_lb'].to_s.capitalize %>,
'enable_vpn': <%= node['openstack']['dashboard']['neutron']['enable_vpn'].to_s.capitalize %>,
'enable_quotas': <%= node['openstack']['dashboard']['neutron']['enable_quotas'] ? 'True' : 'False' %>,
'enable_firewall': <%= node['openstack']['dashboard']['neutron']['enable_fwaas'].to_s.capitalize %>,
# The profile_support option is used to detect if an external router can be
# configured via the dashboard. When using specific plugins the
# profile_support can be turned on if needed.