Add client recipe for network

Add an explicit recipe for installing client
only packages.
Tests are also included.
Bumped minor version for this new feature.

Change-Id: I2e2faa481a2048dc7210132293704730df8f12c8
Addresses: blueprint add-client-recipes
This commit is contained in:
Mark Vanderwiel 2014-02-12 12:03:06 -06:00
parent 3483c3aeca
commit 7e978954a8
7 changed files with 81 additions and 3 deletions

View File

@ -2,6 +2,9 @@
This file is used to list changes made in each version of cookbook-openstack-network.
## 8.1.0
* Add client recipe
## 8.0.1:
* Add network database migration
* Remove unneeded and redundant rhel setup script calls

View File

@ -29,6 +29,11 @@ The following cookbooks are dependencies:
Recipes
=======
client
------
- Install the network client packages
server
------

View File

@ -766,7 +766,7 @@ when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this
'postgresql_python_packages' => ['python-psycopg2'],
'nova_network_packages' => ['openstack-nova-network'],
'neutron_packages' => ['openstack-neutron'],
'neutron_client_packages' => [],
'neutron_client_packages' => ['python-neutronclient'],
'neutron_dhcp_packages' => ['openstack-neutron'],
'neutron_dhcp_build_packages' => [],
'neutron_l3_packages' => ['openstack-neutron'],
@ -793,7 +793,7 @@ when 'suse'
'postgresql_python_packages' => ['python-psycopg2'],
'nova_network_packages' => ['openstack-nova-network'],
'neutron_packages' => ['openstack-neutron'],
'neutron_client_packages' => [],
'neutron_client_packages' => ['python-neutronclient'],
'neutron_dhcp_packages' => ['openstack-neutron-dhcp-agent'],
'neutron_dhcp_build_packages' => [],
'neutron_l3_packages' => ['openstack-neutron-l3-agent'],

View File

@ -5,7 +5,8 @@ maintainer 'Jay Pipes <jaypipes@gmail.com>'
license 'Apache 2.0'
description 'Installs and configures the OpenStack Network API Service and various agents and plugins'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '8.0.1'
version '8.1.0'
recipe 'openstack-network::client', 'Install packages required for network client'
recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server'
recipe 'openstack-network::openvswitch', 'Installs packages required for OVS'
recipe 'openstack-network::metadata_agent', 'Installs packages required for a OpenStack Network Metadata Agent'

32
recipes/client.rb Normal file
View File

@ -0,0 +1,32 @@
# 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.
#
class ::Chef::Recipe # rubocop:disable Documentation
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

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

19
spec/client_spec.rb Normal file
View File

@ -0,0 +1,19 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-network::client' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
runner.converge(described_recipe)
end
it 'installs packages' do
expect(chef_run).to upgrade_package('python-neutronclient')
expect(chef_run).to upgrade_package('python-pyparsing')
end
end
end