summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Cassiba <s@cassiba.com>2016-10-18 11:17:57 -0700
committerChristoph Albers <c.albers@x-ion.de>2016-12-20 08:39:38 +0000
commitf67ff76aae93a4c3e51ad83f62fccd3f04553021 (patch)
treeec659630042012d83a3e76b25c3ca121ceabf5bf
parent3cc01d79ab758555cfec31f54aea22779085a491 (diff)
Deprecated python-neutronclient
- deprecated python-neutronclient references - removed deprecated references to repoforge; use OS-provided package for dnsmasq - removed neutron-client and client-packages Implements blueprint newton-xenial Change-Id: Idcb54b1ece38403dc4fc5dab758ddbdbab8ca968
Notes
Notes (review): Code-Review+2: Christoph Albers <c.albers@x-ion.de> Workflow+1: Jan Klare <j.klare@cloudbau.de> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 20 Dec 2016 11:04:42 +0000 Reviewed-on: https://review.openstack.org/388165 Project: openstack/cookbook-openstack-network Branch: refs/heads/master
-rw-r--r--attributes/default.rb10
-rw-r--r--recipes/client.rb31
-rw-r--r--recipes/default.rb2
-rw-r--r--recipes/dhcp_agent.rb13
-rw-r--r--spec/client-redhat_spec.rb16
-rw-r--r--spec/client_spec.rb16
-rw-r--r--spec/default_spec.rb10
-rw-r--r--spec/dhcp_agent-centos_spec.rb13
-rw-r--r--spec/l3_agent_spec.rb2
-rw-r--r--spec/spec_helper.rb4
10 files changed, 11 insertions, 106 deletions
diff --git a/attributes/default.rb b/attributes/default.rb
index d6e1237..f2a370e 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -82,10 +82,6 @@ end
82# ============================= dnsmasq Configuration =================== 82# ============================= dnsmasq Configuration ===================
83# TODO: (jklare) this should be refactored and probably pull in the some dnsmasq 83# TODO: (jklare) this should be refactored and probably pull in the some dnsmasq
84# cookbook to do the proper configuration 84# cookbook to do the proper configuration
85# the version of dnsmasq for centos 6.5 is two revs behind where the dhcp-agent needs
86# to run properly. This is a version that allows and starts the dhcp-agent correctly.
87default['openstack']['network']['dnsmasq']['rpm_version'] = '2.65-1.el6.rfx.x86_64'
88default['openstack']['network']['dnsmasq']['rpm_source'] = "http://pkgs.repoforge.org/dnsmasq/dnsmasq-#{node['openstack']['network']['dnsmasq']['rpm_version']}.rpm"
89# Upstream resolver to use 85# Upstream resolver to use
90# This will be used by dnsmasq to resolve recursively 86# This will be used by dnsmasq to resolve recursively
91# but will not be used if the tenant specifies a dns 87# but will not be used if the tenant specifies a dns
@@ -108,7 +104,7 @@ default['openstack']['network_dhcp']['conf'].tap do |conf|
108end 104end
109 105
110# ============================= L3 Agent Configuration ===================== 106# ============================= L3 Agent Configuration =====================
111default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1' 107default['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
112 108
113# Customize the l3 config file path 109# Customize the l3 config file path
114default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini' 110default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini'
@@ -226,8 +222,6 @@ default['openstack']['network']['platform'].tap do |platform|
226 when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this 222 when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
227 platform['neutron_packages'] = 223 platform['neutron_packages'] =
228 %w(openstack-neutron openstack-neutron-ml2 iproute) 224 %w(openstack-neutron openstack-neutron-ml2 iproute)
229 platform['neutron_client_packages'] =
230 %w(python-neutronclient)
231 platform['neutron_dhcp_packages'] = 225 platform['neutron_dhcp_packages'] =
232 %w(openstack-neutron iproute) 226 %w(openstack-neutron iproute)
233 platform['neutron_l3_packages'] = 227 platform['neutron_l3_packages'] =
@@ -262,8 +256,6 @@ default['openstack']['network']['platform'].tap do |platform|
262 when 'debian' 256 when 'debian'
263 platform['neutron_packages'] = 257 platform['neutron_packages'] =
264 %w(neutron-common) 258 %w(neutron-common)
265 platform['neutron_client_packages'] =
266 %w(python-neutronclient python-pyparsing)
267 platform['neutron_dhcp_packages'] = 259 platform['neutron_dhcp_packages'] =
268 %w(neutron-dhcp-agent) 260 %w(neutron-dhcp-agent)
269 platform['neutron_l3_packages'] = 261 platform['neutron_l3_packages'] =
diff --git a/recipes/client.rb b/recipes/client.rb
deleted file mode 100644
index bb1d230..0000000
--- a/recipes/client.rb
+++ /dev/null
@@ -1,31 +0,0 @@
1# encoding: UTF-8
2#
3# Cookbook Name:: openstack-network
4# Recipe:: client
5#
6# Copyright 2014, IBM Corp.
7#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#
20# Make Openstack object available in Chef::Recipe
21class ::Chef::Recipe
22 include ::Openstack
23end
24
25platform_options = node['openstack']['network']['platform']
26platform_options['neutron_client_packages'].each do |pkg|
27 package pkg do
28 options platform_options['package_overrides']
29 action :upgrade
30 end
31end
diff --git a/recipes/default.rb b/recipes/default.rb
index ac25c98..d39b4ea 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -20,8 +20,6 @@
20# limitations under the License. 20# limitations under the License.
21# 21#
22 22
23include_recipe 'openstack-network::client'
24
25require 'uri' 23require 'uri'
26 24
27# Make Openstack object available in Chef::Recipe 25# Make Openstack object available in Chef::Recipe
diff --git a/recipes/dhcp_agent.rb b/recipes/dhcp_agent.rb
index 6f676a3..7a08f21 100644
--- a/recipes/dhcp_agent.rb
+++ b/recipes/dhcp_agent.rb
@@ -54,17 +54,8 @@ end
54# cookbook to do the proper configuration 54# cookbook to do the proper configuration
55case node['platform'] 55case node['platform']
56when 'centos' 56when 'centos'
57 if node['platform_version'].to_f < 7.1 57 rpm_package 'dnsmasq' do
58 dnsmasq_file = "#{Chef::Config[:file_cache_path]}/#{node['openstack']['network']['dnsmasq']['rpm_version']}" 58 action :upgrade
59 remote_file dnsmasq_file do
60 source node['openstack']['network']['dnsmasq']['rpm_source']
61 not_if { ::File.exist?(dnsmasq_file) || node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
62 end
63 rpm_package 'dnsmasq' do
64 source dnsmasq_file
65 action :install
66 not_if { node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
67 end
68 end 59 end
69end 60end
70 61
diff --git a/spec/client-redhat_spec.rb b/spec/client-redhat_spec.rb
deleted file mode 100644
index 273fbf1..0000000
--- a/spec/client-redhat_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
1# encoding: UTF-8
2require_relative 'spec_helper'
3
4describe 'openstack-network::client' do
5 describe 'redhat' do
6 let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
7 let(:node) { runner.node }
8 let(:chef_run) do
9 runner.converge(described_recipe)
10 end
11
12 it 'upgrades python neutron client package' do
13 expect(chef_run).to upgrade_package('python-neutronclient')
14 end
15 end
16end
diff --git a/spec/client_spec.rb b/spec/client_spec.rb
deleted file mode 100644
index 850b764..0000000
--- a/spec/client_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
1require_relative 'spec_helper'
2
3describe 'openstack-network::client' do
4 describe 'ubuntu' do
5 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
6 let(:node) { runner.node }
7 let(:chef_run) do
8 runner.converge(described_recipe)
9 end
10
11 it 'upgrades python neutron client package' do
12 expect(chef_run).to upgrade_package('python-neutronclient')
13 expect(chef_run).to upgrade_package('python-pyparsing')
14 end
15 end
16end
diff --git a/spec/default_spec.rb b/spec/default_spec.rb
index 29843f0..2162be1 100644
--- a/spec/default_spec.rb
+++ b/spec/default_spec.rb
@@ -11,11 +11,7 @@ describe 'openstack-network' do
11 11
12 include_context 'neutron-stubs' 12 include_context 'neutron-stubs'
13 13
14 it do 14 %w(neutron-common python-mysqldb).each do |package|
15 expect(chef_run).to include_recipe('openstack-network::client')
16 end
17
18 %w(neutron-common python-pyparsing python-mysqldb).each do |package|
19 it do 15 it do
20 expect(chef_run).to upgrade_package(package) 16 expect(chef_run).to upgrade_package(package)
21 end 17 end
@@ -79,7 +75,7 @@ describe 'openstack-network' do
79 .with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/) 75 .with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/)
80 end 76 end
81 end 77 end
82 describe 'has no rabbit values if rpc_backend is not default' do 78 describe 'has no rabbit value if rpc_backend is not default' do
83 before do 79 before do
84 node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit' 80 node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit'
85 end 81 end
@@ -94,9 +90,9 @@ describe 'openstack-network' do
94 let(:file) { chef_run.template('/etc/neutron/neutron.conf') } 90 let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
95 [ 91 [
96 %r{^log_dir = /var/log/neutron$}, 92 %r{^log_dir = /var/log/neutron$},
93 /^rpc_backend = rabbit$/,
97 /^control_exchange = neutron$/, 94 /^control_exchange = neutron$/,
98 /^core_plugin = ml2$/, 95 /^core_plugin = ml2$/,
99 /^rpc_backend = rabbit$/,
100 /^bind_host = 127\.0\.0\.1$/, 96 /^bind_host = 127\.0\.0\.1$/,
101 /^bind_port = 9696$/ 97 /^bind_port = 9696$/
102 ].each do |line| 98 ].each do |line|
diff --git a/spec/dhcp_agent-centos_spec.rb b/spec/dhcp_agent-centos_spec.rb
index 95d9583..e0730d0 100644
--- a/spec/dhcp_agent-centos_spec.rb
+++ b/spec/dhcp_agent-centos_spec.rb
@@ -27,23 +27,14 @@ describe 'openstack-network::dhcp_agent' do
27 expect(chef_run).to enable_service('neutron-dhcp-agent') 27 expect(chef_run).to enable_service('neutron-dhcp-agent')
28 end 28 end
29 29
30 it 'should have the correct dnsmasq remote file' do 30 it 'should install the dnsmasq rpm' do
31 expect(chef_run).to create_remote_file("#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64").with(source: 'http://pkgs.repoforge.org/dnsmasq/dnsmasq-2.65-1.el6.rfx.x86_64.rpm') 31 expect(chef_run).to upgrade_rpm_package('dnsmasq')
32 end
33
34 it 'should install the corrcet dnsmasq rpm' do
35 expect(chef_run).to install_rpm_package('dnsmasq').with(source: "#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
36 end 32 end
37 33
38 it 'should notify dhcp agent to restart immediately' do 34 it 'should notify dhcp agent to restart immediately' do
39 expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed 35 expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed
40 end 36 end
41 37
42 it 'should not have the correct dnsmasq remote file when no version' do
43 node.set['openstack']['network']['dnsmasq']['rpm_version'] = ''
44 expect(chef_run).not_to create_remote_file("#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
45 end
46
47 describe '/etc/neutron/dhcp_agent.ini' do 38 describe '/etc/neutron/dhcp_agent.ini' do
48 let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') } 39 let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') }
49 40
diff --git a/spec/l3_agent_spec.rb b/spec/l3_agent_spec.rb
index 35ff2c0..087254b 100644
--- a/spec/l3_agent_spec.rb
+++ b/spec/l3_agent_spec.rb
@@ -6,7 +6,7 @@ describe 'openstack-network::l3_agent' do
6 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } 6 let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
7 let(:node) { runner.node } 7 let(:node) { runner.node }
8 let(:chef_run) do 8 let(:chef_run) do
9 node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1' 9 node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
10 runner.converge(described_recipe) 10 runner.converge(described_recipe)
11 end 11 end
12 describe 'recipe' do 12 describe 'recipe' do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 49fdfff..cb5ca82 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -15,12 +15,12 @@ REDHAT_OPTS = {
15}.freeze 15}.freeze
16UBUNTU_OPTS = { 16UBUNTU_OPTS = {
17 platform: 'ubuntu', 17 platform: 'ubuntu',
18 version: '14.04', 18 version: '16.04',
19 log_level: LOG_LEVEL 19 log_level: LOG_LEVEL
20}.freeze 20}.freeze
21CENTOS_OPTS = { 21CENTOS_OPTS = {
22 platform: 'centos', 22 platform: 'centos',
23 version: '6.5', 23 version: '7.2.1511',
24 log_level: LOG_LEVEL 24 log_level: LOG_LEVEL
25}.freeze 25}.freeze
26 26