From 16441178af93ca8c0ba4f680800d965f518e26f8 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Fri, 14 Jun 2019 15:32:05 -0700 Subject: [PATCH] Drop poise-python in favor of directly installing python packages The poise-python cookbook is no longer maintained by the upstream maintainer and is causing lots of issues for the testing pipeline. Originally we needed this to install a newer openstack-client via pip, but we no longer do that. The one exception is in the integration cookbook which I'll be pushing a change for that as well. In order to do this, we need to include EPEL on RHEL which doesn't seem to have any current dependency issues so I think it's safe to bring back. Depends-On: https://review.opendev.org/665493 Change-Id: Ic8ddf736193a6a7cea5372f2fd09e2def3634333 Signed-off-by: Lance Albertson --- attributes/default.rb | 16 ++++++++++++++++ metadata.rb | 2 +- recipes/default.rb | 12 +++++------- spec/default-redhat_spec.rb | 22 ++++++++++++---------- spec/default_spec.rb | 6 ++++++ 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 9b25cb23..7c38129e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -292,11 +292,27 @@ case node['platform_family'] when 'rhel' default['openstack']['common']['platform'] = { 'common_client_packages' => ['python-openstackclient'], + 'python2_packages' => [ + 'python', + 'python2-pip', + 'python2-setuptools', + 'python-devel', + 'python-virtualenv', + 'python-wheel', + ], 'package_overrides' => '', } when 'debian' default['openstack']['common']['platform'] = { 'common_client_packages' => ['python-openstackclient'], + 'python2_packages' => [ + 'python', + 'python-dev', + 'python-pip', + 'python-setuptools', + 'python-virtualenv', + 'python-wheel', + ], 'package_overrides' => '', } end diff --git a/metadata.rb b/metadata.rb index b7af2bb9..99609836 100644 --- a/metadata.rb +++ b/metadata.rb @@ -18,8 +18,8 @@ depends 'etcd', '~> 5.5' depends 'mariadb', '~> 1.5' depends 'memcached', '~> 4.1' depends 'mysql', '~> 8.2' -depends 'poise-python', '~> 1.7' depends 'selinux' +depends 'yum-epel' issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url) source_url 'https://github.com/openstack/cookbook-openstack-common' if respond_to?(:source_url) diff --git a/recipes/default.rb b/recipes/default.rb index 6fa46d11..4b9af412 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -73,6 +73,8 @@ when 'debian' end when 'rhel' + include_recipe 'yum-epel' + repo_action = if node['openstack']['yum']['rdo_enabled'] :add elsif FileTest.exist? "/etc/yum.repos.d/RDO-#{node['openstack']['release']}.repo" @@ -121,13 +123,9 @@ when 'rhel' end # install a python -python_runtime '2' do - provider :system - # Workaround for https://github.com/poise/poise-python/issues/133 - pip_version '18.0' - # Align with eg. OpenStack-Ansible (https://opendev.org/openstack/openstack-ansible/tree/global-requirement-pins.txt) - setuptools_version '40.0.0' - wheel_version '0.31.1' +package node['openstack']['common']['platform']['python2_packages'] do + options platform_options['package_overrides'] + action :upgrade end if node['openstack']['databag_type'] == 'vault' diff --git a/spec/default-redhat_spec.rb b/spec/default-redhat_spec.rb index 3690d740..b47ea0d3 100644 --- a/spec/default-redhat_spec.rb +++ b/spec/default-redhat_spec.rb @@ -15,6 +15,12 @@ describe 'openstack-common::default' do expect(chef_run).to upgrade_package('centos-release-qemu-ev') end + pkgs = %w(python python2-pip python2-setuptools python-devel python-virtualenv python-wheel) + + it 'installs python2 packages' do + expect(chef_run).to upgrade_package(pkgs) + end + context 'enabling RDO with gpgcheck enabled' do before do node.override['openstack']['yum']['rdo_enabled'] = true @@ -28,12 +34,8 @@ describe 'openstack-common::default' do .with(gpgcheck: true) end - it 'does not include yum recipe' do - expect(chef_run).to_not include_recipe('yum') - end - - it 'does not include yum-epel recipe' do - expect(chef_run).to_not include_recipe('yum-epel') + it 'does include yum-epel recipe' do + expect(chef_run).to include_recipe('yum-epel') end end @@ -48,8 +50,8 @@ describe 'openstack-common::default' do .with(gpgcheck: false) end - it 'does not include yum-epel recipe' do - expect(chef_run).to_not include_recipe('yum-epel') + it 'does include yum-epel recipe' do + expect(chef_run).to include_recipe('yum-epel') end end @@ -81,8 +83,8 @@ describe 'openstack-common::default' do expect(repo.performed_actions).to be_empty end - it 'does not include yum-epel recipe' do - expect(chef_run).to_not include_recipe('yum-epel') + it 'does include yum-epel recipe' do + expect(chef_run).to include_recipe('yum-epel') end it 'does not create RDO-Manager yum repositories' do diff --git a/spec/default_spec.rb b/spec/default_spec.rb index 42035378..dc18f908 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -62,6 +62,12 @@ describe 'openstack-common::default' do ) end + pkgs = %w(python python-dev python-pip python-setuptools python-virtualenv python-wheel) + + it 'installs python2 packages' do + expect(chef_run).to upgrade_package(pkgs) + end + it 'does not install the gem chef-vault by default' do expect(chef_run).to_not install_chef_gem('chef-vault') end