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
This commit is contained in:
Samuel Cassiba 2016-10-18 11:17:57 -07:00 committed by Christoph Albers
parent 3cc01d79ab
commit f67ff76aae
10 changed files with 11 additions and 106 deletions

View File

@ -82,10 +82,6 @@ end
# ============================= dnsmasq Configuration ===================
# TODO: (jklare) this should be refactored and probably pull in the some dnsmasq
# cookbook to do the proper configuration
# the version of dnsmasq for centos 6.5 is two revs behind where the dhcp-agent needs
# to run properly. This is a version that allows and starts the dhcp-agent correctly.
default['openstack']['network']['dnsmasq']['rpm_version'] = '2.65-1.el6.rfx.x86_64'
default['openstack']['network']['dnsmasq']['rpm_source'] = "http://pkgs.repoforge.org/dnsmasq/dnsmasq-#{node['openstack']['network']['dnsmasq']['rpm_version']}.rpm"
# Upstream resolver to use
# This will be used by dnsmasq to resolve recursively
# but will not be used if the tenant specifies a dns
@ -108,7 +104,7 @@ default['openstack']['network_dhcp']['conf'].tap do |conf|
end
# ============================= L3 Agent Configuration =====================
default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1'
default['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
# Customize the l3 config file path
default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini'
@ -226,8 +222,6 @@ default['openstack']['network']['platform'].tap do |platform|
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
platform['neutron_packages'] =
%w(openstack-neutron openstack-neutron-ml2 iproute)
platform['neutron_client_packages'] =
%w(python-neutronclient)
platform['neutron_dhcp_packages'] =
%w(openstack-neutron iproute)
platform['neutron_l3_packages'] =
@ -262,8 +256,6 @@ default['openstack']['network']['platform'].tap do |platform|
when 'debian'
platform['neutron_packages'] =
%w(neutron-common)
platform['neutron_client_packages'] =
%w(python-neutronclient python-pyparsing)
platform['neutron_dhcp_packages'] =
%w(neutron-dhcp-agent)
platform['neutron_l3_packages'] =

View File

@ -1,31 +0,0 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-network
# Recipe:: client
#
# Copyright 2014, IBM Corp.
#
# 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.
#
# Make Openstack object available in Chef::Recipe
class ::Chef::Recipe
include ::Openstack
end
platform_options = node['openstack']['network']['platform']
platform_options['neutron_client_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']
action :upgrade
end
end

View File

@ -20,8 +20,6 @@
# limitations under the License.
#
include_recipe 'openstack-network::client'
require 'uri'
# Make Openstack object available in Chef::Recipe

View File

@ -54,17 +54,8 @@ end
# cookbook to do the proper configuration
case node['platform']
when 'centos'
if node['platform_version'].to_f < 7.1
dnsmasq_file = "#{Chef::Config[:file_cache_path]}/#{node['openstack']['network']['dnsmasq']['rpm_version']}"
remote_file dnsmasq_file do
source node['openstack']['network']['dnsmasq']['rpm_source']
not_if { ::File.exist?(dnsmasq_file) || node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
end
rpm_package 'dnsmasq' do
source dnsmasq_file
action :install
not_if { node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
end
rpm_package 'dnsmasq' do
action :upgrade
end
end

View File

@ -1,16 +0,0 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-network::client' do
describe 'redhat' do
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
runner.converge(described_recipe)
end
it 'upgrades python neutron client package' do
expect(chef_run).to upgrade_package('python-neutronclient')
end
end
end

View File

@ -1,16 +0,0 @@
require_relative 'spec_helper'
describe 'openstack-network::client' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
runner.converge(described_recipe)
end
it 'upgrades python neutron client package' do
expect(chef_run).to upgrade_package('python-neutronclient')
expect(chef_run).to upgrade_package('python-pyparsing')
end
end
end

View File

@ -11,11 +11,7 @@ describe 'openstack-network' do
include_context 'neutron-stubs'
it do
expect(chef_run).to include_recipe('openstack-network::client')
end
%w(neutron-common python-pyparsing python-mysqldb).each do |package|
%w(neutron-common python-mysqldb).each do |package|
it do
expect(chef_run).to upgrade_package(package)
end
@ -79,7 +75,7 @@ describe 'openstack-network' do
.with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/)
end
end
describe 'has no rabbit values if rpc_backend is not default' do
describe 'has no rabbit value if rpc_backend is not default' do
before do
node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit'
end
@ -94,9 +90,9 @@ describe 'openstack-network' do
let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
[
%r{^log_dir = /var/log/neutron$},
/^rpc_backend = rabbit$/,
/^control_exchange = neutron$/,
/^core_plugin = ml2$/,
/^rpc_backend = rabbit$/,
/^bind_host = 127\.0\.0\.1$/,
/^bind_port = 9696$/
].each do |line|

View File

@ -27,23 +27,14 @@ describe 'openstack-network::dhcp_agent' do
expect(chef_run).to enable_service('neutron-dhcp-agent')
end
it 'should have the correct dnsmasq remote file' do
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')
end
it 'should install the corrcet dnsmasq rpm' do
expect(chef_run).to install_rpm_package('dnsmasq').with(source: "#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
it 'should install the dnsmasq rpm' do
expect(chef_run).to upgrade_rpm_package('dnsmasq')
end
it 'should notify dhcp agent to restart immediately' do
expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed
end
it 'should not have the correct dnsmasq remote file when no version' do
node.set['openstack']['network']['dnsmasq']['rpm_version'] = ''
expect(chef_run).not_to create_remote_file("#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
end
describe '/etc/neutron/dhcp_agent.ini' do
let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') }

View File

@ -6,7 +6,7 @@ describe 'openstack-network::l3_agent' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1'
node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
runner.converge(described_recipe)
end
describe 'recipe' do

View File

@ -15,12 +15,12 @@ REDHAT_OPTS = {
}.freeze
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '14.04',
version: '16.04',
log_level: LOG_LEVEL
}.freeze
CENTOS_OPTS = {
platform: 'centos',
version: '6.5',
version: '7.2.1511',
log_level: LOG_LEVEL
}.freeze