Browse Source

Merge "Deprecated python-neutronclient"

Jenkins 2 years ago
parent
commit
d885b68c6d

+ 1
- 9
attributes/default.rb View File

@@ -82,10 +82,6 @@ end
82 82
 # ============================= dnsmasq Configuration ===================
83 83
 # TODO: (jklare) this should be refactored and probably pull in the some dnsmasq
84 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.
87
-default['openstack']['network']['dnsmasq']['rpm_version'] = '2.65-1.el6.rfx.x86_64'
88
-default['openstack']['network']['dnsmasq']['rpm_source'] = "http://pkgs.repoforge.org/dnsmasq/dnsmasq-#{node['openstack']['network']['dnsmasq']['rpm_version']}.rpm"
89 85
 # Upstream resolver to use
90 86
 # This will be used by dnsmasq to resolve recursively
91 87
 # but will not be used if the tenant specifies a dns
@@ -108,7 +104,7 @@ default['openstack']['network_dhcp']['conf'].tap do |conf|
108 104
 end
109 105
 
110 106
 # ============================= L3 Agent Configuration =====================
111
-default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1'
107
+default['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
112 108
 
113 109
 # Customize the l3 config file path
114 110
 default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini'
@@ -226,8 +222,6 @@ default['openstack']['network']['platform'].tap do |platform|
226 222
   when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
227 223
     platform['neutron_packages'] =
228 224
       %w(openstack-neutron openstack-neutron-ml2 iproute)
229
-    platform['neutron_client_packages'] =
230
-      %w(python-neutronclient)
231 225
     platform['neutron_dhcp_packages'] =
232 226
       %w(openstack-neutron iproute)
233 227
     platform['neutron_l3_packages'] =
@@ -262,8 +256,6 @@ default['openstack']['network']['platform'].tap do |platform|
262 256
   when 'debian'
263 257
     platform['neutron_packages'] =
264 258
       %w(neutron-common)
265
-    platform['neutron_client_packages'] =
266
-      %w(python-neutronclient python-pyparsing)
267 259
     platform['neutron_dhcp_packages'] =
268 260
       %w(neutron-dhcp-agent)
269 261
     platform['neutron_l3_packages'] =

+ 0
- 31
recipes/client.rb View File

@@ -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
21
-class ::Chef::Recipe
22
-  include ::Openstack
23
-end
24
-
25
-platform_options = node['openstack']['network']['platform']
26
-platform_options['neutron_client_packages'].each do |pkg|
27
-  package pkg do
28
-    options platform_options['package_overrides']
29
-    action :upgrade
30
-  end
31
-end

+ 0
- 2
recipes/default.rb View File

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

+ 2
- 11
recipes/dhcp_agent.rb View File

@@ -54,17 +54,8 @@ end
54 54
 # cookbook to do the proper configuration
55 55
 case node['platform']
56 56
 when 'centos'
57
-  if node['platform_version'].to_f < 7.1
58
-    dnsmasq_file = "#{Chef::Config[:file_cache_path]}/#{node['openstack']['network']['dnsmasq']['rpm_version']}"
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
57
+  rpm_package 'dnsmasq' do
58
+    action :upgrade
68 59
   end
69 60
 end
70 61
 

+ 0
- 16
spec/client-redhat_spec.rb View File

@@ -1,16 +0,0 @@
1
-# encoding: UTF-8
2
-require_relative 'spec_helper'
3
-
4
-describe '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
16
-end

+ 0
- 16
spec/client_spec.rb View File

@@ -1,16 +0,0 @@
1
-require_relative 'spec_helper'
2
-
3
-describe '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
16
-end

+ 3
- 7
spec/default_spec.rb View File

@@ -11,11 +11,7 @@ describe 'openstack-network' do
11 11
 
12 12
     include_context 'neutron-stubs'
13 13
 
14
-    it do
15
-      expect(chef_run).to include_recipe('openstack-network::client')
16
-    end
17
-
18
-    %w(neutron-common python-pyparsing  python-mysqldb).each do |package|
14
+    %w(neutron-common python-mysqldb).each do |package|
19 15
       it do
20 16
         expect(chef_run).to upgrade_package(package)
21 17
       end
@@ -79,7 +75,7 @@ describe 'openstack-network' do
79 75
             .with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/)
80 76
         end
81 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 79
         before do
84 80
           node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit'
85 81
         end
@@ -94,9 +90,9 @@ describe 'openstack-network' do
94 90
       let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
95 91
       [
96 92
         %r{^log_dir = /var/log/neutron$},
93
+        /^rpc_backend = rabbit$/,
97 94
         /^control_exchange = neutron$/,
98 95
         /^core_plugin = ml2$/,
99
-        /^rpc_backend = rabbit$/,
100 96
         /^bind_host = 127\.0\.0\.1$/,
101 97
         /^bind_port = 9696$/
102 98
       ].each do |line|

+ 2
- 11
spec/dhcp_agent-centos_spec.rb View File

@@ -27,23 +27,14 @@ describe 'openstack-network::dhcp_agent' do
27 27
       expect(chef_run).to enable_service('neutron-dhcp-agent')
28 28
     end
29 29
 
30
-    it 'should have the correct dnsmasq remote file' 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')
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")
30
+    it 'should install the dnsmasq rpm' do
31
+      expect(chef_run).to upgrade_rpm_package('dnsmasq')
36 32
     end
37 33
 
38 34
     it 'should notify dhcp agent to restart immediately' do
39 35
       expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed
40 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 38
     describe '/etc/neutron/dhcp_agent.ini' do
48 39
       let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') }
49 40
 

+ 1
- 1
spec/l3_agent_spec.rb View File

@@ -6,7 +6,7 @@ describe 'openstack-network::l3_agent' do
6 6
     let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
7 7
     let(:node) { runner.node }
8 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 10
       runner.converge(described_recipe)
11 11
     end
12 12
     describe 'recipe' do

+ 2
- 2
spec/spec_helper.rb View File

@@ -15,12 +15,12 @@ REDHAT_OPTS = {
15 15
 }.freeze
16 16
 UBUNTU_OPTS = {
17 17
   platform: 'ubuntu',
18
-  version: '14.04',
18
+  version: '16.04',
19 19
   log_level: LOG_LEVEL
20 20
 }.freeze
21 21
 CENTOS_OPTS = {
22 22
   platform: 'centos',
23
-  version: '6.5',
23
+  version: '7.2.1511',
24 24
   log_level: LOG_LEVEL
25 25
 }.freeze
26 26
 

Loading…
Cancel
Save