Allow packages to be updatable

In order for package updates to occur, package resources need to use
the upgrade action.  This is first phase of blueprint, to get some
consistency, next phase is to allow some update control.

Change-Id: Ibf9aeea1a814383c298e432286c45a433ff257ed
Implements: blueprint allow-package-updates
This commit is contained in:
Mark Vanderwiel 2014-05-01 15:41:38 -05:00
parent 5f8300c216
commit 23754b4c06
17 changed files with 52 additions and 50 deletions

View File

@ -1,8 +1,10 @@
openstack-block-storage Cookbook CHANGELOG
==============================
This file is used to list changes made in each version of the openstack-block-storage cookbook.
## 9.1.1
* Fix package action to allow updates
## 9.0.2
## 9.1.0
### Blue print
* Remove policy template

View File

@ -5,7 +5,7 @@ maintainer_email 'cookbooks@lists.tfoundry.com'
license 'Apache 2.0'
description 'The OpenStack Advanced Volume Management service Cinder.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '9.1.0'
version '9.1.1'
recipe 'openstack-block-storage::api', 'Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone'
recipe 'openstack-block-storage::client', 'Install packages required for cinder client'

View File

@ -67,7 +67,7 @@ when 'cinder.volume.drivers.rbd.RBDDriver'
platform_options['cinder_ceph_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']
action :install
action :upgrade
end
end

View File

@ -12,15 +12,15 @@ describe 'openstack-block-storage::api' do
include_context 'block-storage-stubs'
it 'installs cinder api packages' do
it 'upgrades cinder api package' do
expect(chef_run).to upgrade_package 'openstack-cinder-api'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package 'python-mysql'
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'

View File

@ -12,15 +12,15 @@ describe 'openstack-block-storage::api' do
include_context 'block-storage-stubs'
it 'installs cinder api packages' do
it 'upgrades cinder api package' do
expect(chef_run).to upgrade_package 'python-cinderclient'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package 'MySQL-python'
end
it 'installs db2 python packages if explicitly told' do
it 'upgrades db2 python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'db2'
['python-ibm-db', 'python-ibm-db-sa'].each do |pkg|
@ -28,7 +28,7 @@ describe 'openstack-block-storage::api' do
end
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'

View File

@ -15,7 +15,7 @@ describe 'openstack-block-storage::api' do
expect_creates_cinder_conf 'service[cinder-api]', 'cinder', 'cinder'
it 'installs cinder api packages' do
it 'upgrades cinder api packages' do
expect(chef_run).to upgrade_package('cinder-api')
expect(chef_run).to upgrade_package('python-cinderclient')
end
@ -24,11 +24,11 @@ describe 'openstack-block-storage::api' do
expect(chef_run).to enable_service('cinder-api')
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package('python-mysqldb')
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package('python-psycopg2')

View File

@ -12,7 +12,7 @@ describe 'openstack-block-storage::cinder-common' do
include_context 'block-storage-stubs'
it 'installs the openstack-cinder package' do
it 'upgrades the openstack-cinder package' do
expect(chef_run).to upgrade_package 'openstack-cinder'
end
end

View File

@ -12,7 +12,7 @@ describe 'openstack-block-storage::cinder-common' do
include_context 'block-storage-stubs'
it 'installs the openstack-cinder package' do
it 'upgrades the openstack-cinder package' do
expect(chef_run).to upgrade_package 'openstack-cinder'
end
end

View File

@ -17,7 +17,7 @@ describe 'openstack-block-storage::cinder-common' do
include_context 'block-storage-stubs'
it 'installs the cinder-common package' do
it 'upgrades the cinder-common package' do
expect(chef_run).to upgrade_package 'cinder-common'
end

View File

@ -9,7 +9,7 @@ describe 'openstack-block-storage::client' do
runner.converge(described_recipe)
end
it 'installs packages' do
it 'upgrades packages' do
expect(chef_run).to upgrade_package('python-cinderclient')
end
end

View File

@ -9,7 +9,7 @@ describe 'openstack-block-storage::client' do
runner.converge(described_recipe)
end
it 'installs packages' do
it 'upgrades packages' do
expect(chef_run).to upgrade_package('python-cinderclient')
end
end

View File

@ -12,7 +12,7 @@ describe 'openstack-block-storage::scheduler' do
include_context 'block-storage-stubs'
it 'installs cinder scheduler packages' do
it 'upgrades cinder scheduler package' do
expect(chef_run).to upgrade_package 'openstack-cinder'
end
@ -28,11 +28,11 @@ describe 'openstack-block-storage::scheduler' do
expect(chef_run).not_to upgrade_python_pip 'stevedore'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package 'MySQL-python'
end
it 'installs db2 python packages if explicitly told' do
it 'upgrades db2 python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'db2'
['python-ibm-db', 'python-ibm-db-sa'].each do |pkg|
@ -40,7 +40,7 @@ describe 'openstack-block-storage::scheduler' do
end
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'

View File

@ -12,7 +12,7 @@ describe 'openstack-block-storage::scheduler' do
include_context 'block-storage-stubs'
it 'installs cinder scheduler packages' do
it 'upgrades cinder scheduler package' do
expect(chef_run).to upgrade_package 'openstack-cinder-scheduler'
end
@ -28,11 +28,11 @@ describe 'openstack-block-storage::scheduler' do
expect(chef_run).not_to upgrade_python_pip 'stevedore'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package 'python-mysql'
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'

View File

@ -15,7 +15,7 @@ describe 'openstack-block-storage::scheduler' do
expect_creates_cinder_conf 'service[cinder-scheduler]', 'cinder', 'cinder'
it 'installs cinder scheduler packages' do
it 'upgrades cinder scheduler package' do
expect(chef_run).to upgrade_package 'cinder-scheduler'
end
@ -27,11 +27,11 @@ describe 'openstack-block-storage::scheduler' do
expect(chef_run).to enable_service 'cinder-scheduler'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package 'python-mysqldb'
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'

View File

@ -12,11 +12,11 @@ describe 'openstack-block-storage::volume' do
include_context 'block-storage-stubs'
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package('MySQL-python')
end
it 'installs db2 python packages if explicitly told' do
it 'upgrades db2 python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'db2'
['python-ibm-db', 'python-ibm-db-sa'].each do |pkg|
@ -24,14 +24,14 @@ describe 'openstack-block-storage::volume' do
end
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package('python-psycopg2')
expect(chef_run).not_to upgrade_package('MySQL-python')
end
it 'installs cinder iscsi packages' do
it 'upgrades cinder iscsi package' do
expect(chef_run).to upgrade_package('scsi-target-utils')
end
@ -75,7 +75,7 @@ describe 'openstack-block-storage::volume' do
expect(chef_run).to render_file(file.name).with_content('127.0.0.1:/ibm/fs/export')
end
it 'installs nfs packages' do
it 'upgrades nfs packages' do
expect(chef_run).to upgrade_package 'nfs-utils'
expect(chef_run).to upgrade_package 'nfs-utils-lib'
end
@ -94,7 +94,7 @@ describe 'openstack-block-storage::volume' do
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver'
end
it 'installs nfs packages' do
it 'upgrades nfs packages' do
expect(chef_run).to upgrade_package('nfs-utils')
expect(chef_run).to upgrade_package('nfs-utils-lib')
end
@ -105,7 +105,7 @@ describe 'openstack-block-storage::volume' do
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver'
end
it 'installs emc packages' do
it 'upgrades emc package' do
expect(chef_run).to upgrade_package('pywbem')
end
end

View File

@ -12,22 +12,22 @@ describe 'openstack-block-storage::volume' do
include_context 'block-storage-stubs'
it 'installs cinder volume packages' do
it 'upgrades cinder volume package' do
expect(chef_run).to upgrade_package('openstack-cinder-volume')
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python package' do
expect(chef_run).to upgrade_package('python-mysql')
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package('python-psycopg2')
expect(chef_run).not_to upgrade_package('python-mysql')
end
it 'installs cinder iscsi packages' do
it 'upgrades cinder iscsi package' do
expect(chef_run).to upgrade_package('tgt')
end

View File

@ -15,7 +15,7 @@ describe 'openstack-block-storage::volume' do
expect_creates_cinder_conf('service[cinder-volume]', 'cinder', 'cinder')
it 'installs cinder volume packages' do
it 'upgrades cinder volume packages' do
expect(chef_run).to upgrade_package 'cinder-volume'
end
@ -31,22 +31,22 @@ describe 'openstack-block-storage::volume' do
expect(chef_run).to enable_service 'tgt'
end
it 'installs mysql python packages by default' do
it 'upgrades mysql python packages by default' do
expect(chef_run).to upgrade_package 'python-mysqldb'
end
it 'installs postgresql python packages if explicitly told' do
it 'upgrades postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'
expect(chef_run).not_to upgrade_package 'python-mysqldb'
end
it 'installs cinder iscsi packages' do
it 'upgrades cinder iscsi package' do
expect(chef_run).to upgrade_package 'tgt'
end
it 'installs emc packages' do
it 'upgrades emc package' do
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver'
expect(chef_run).to upgrade_package 'python-pywbem'
@ -74,7 +74,7 @@ describe 'openstack-block-storage::volume' do
end
end
it 'installs nfs packages' do
it 'upgrades nfs package' do
expect(chef_run).to upgrade_package 'nfs-common'
end
@ -93,7 +93,7 @@ describe 'openstack-block-storage::volume' do
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver'
end
it 'installs nfs packages' do
it 'upgrades nfs package' do
expect(chef_run).to upgrade_package 'nfs-common'
end
@ -160,9 +160,9 @@ describe 'openstack-block-storage::volume' do
expect(chef_run).to include_recipe('openstack-common::ceph_client')
end
it 'installs the needed ceph packages by default' do
it 'upgrades the needed ceph packages by default' do
%w{ python-ceph ceph-common }.each do |pkg|
expect(chef_run).to install_package(pkg)
expect(chef_run).to upgrade_package(pkg)
end
end
@ -171,7 +171,7 @@ describe 'openstack-block-storage::volume' do
node.set['openstack']['block-storage']['platform']['package_overrides'] = '--override1 --override2'
%w{ python-ceph ceph-common }.each do |pkg|
expect(chef_run).to install_package(pkg).with(options: '--override1 --override2')
expect(chef_run).to upgrade_package(pkg).with(options: '--override1 --override2')
end
end
@ -180,7 +180,7 @@ describe 'openstack-block-storage::volume' do
node.set['openstack']['block-storage']['platform']['cinder_ceph_packages'] = ['my-ceph', 'my-other-ceph']
%w{my-ceph my-other-ceph}.each do |pkg|
expect(chef_run).to install_package(pkg)
expect(chef_run).to upgrade_package(pkg)
end
end