install python-openstackclient from pip and not from package

* the packaged version of python-openstackclient for ubuntu and centos are quite
  old and we need the new version to completely switch all cookbook logic to the
  openstackclient
* this patch include the poise-python cookbook and uses its resources to install
  a python 2 environment and the python-openstackclient

Change-Id: I881075dcd11d06d9c1537d929c7626155c01a1d6
This commit is contained in:
Jan Klare 2016-08-05 11:52:11 +02:00
parent da21e16aa0
commit 83a9525fd0
5 changed files with 11 additions and 26 deletions

View File

@ -286,12 +286,10 @@ default['openstack']['sysctl']['net.ipv4.conf.default.rp_filter'] = 0
case node['platform_family']
when 'rhel'
default['openstack']['common']['platform'] = {
'common_client_packages' => ['python-openstackclient'],
'package_overrides' => ''
}
when 'debian'
default['openstack']['common']['platform'] = {
'common_client_packages' => ['python-openstackclient'],
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
}
end

View File

@ -23,3 +23,4 @@ depends 'mysql', '~> 6.0.13'
depends 'yum', '~> 3.5.4'
depends 'yum-epel', '~> 0.6.0'
depends 'galera', '~> 0.4.1'
depends 'poise-python', '~> 1.4.0'

View File

@ -18,11 +18,8 @@
# limitations under the License.
#
platform_options = node['openstack']['common']['platform']
platform_options['common_client_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']
python_runtime '2'
action :upgrade
end
python_package 'python-openstackclient' do
version '2.6'
end

View File

@ -1,16 +0,0 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-common::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 common client packages' do
expect(chef_run).to upgrade_package('python-openstackclient')
end
end
end

View File

@ -9,8 +9,13 @@ describe 'openstack-common::client' do
runner.converge(described_recipe)
end
it 'upgrades common client packages' do
expect(chef_run).to upgrade_package('python-openstackclient')
it 'installs the latest python 2' do
expect(chef_run).to install_python_runtime('2')
end
it 'installs python-openstackclient 2.6' do
expect(chef_run).to install_python_package('python-openstackclient')
.with(version: '2.6')
end
end
end