Skip to content

Commit

Permalink
Drop EoL CentOS 7/8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 27, 2024
1 parent 1a1e8b5 commit de7d06e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 76 deletions.
5 changes: 1 addition & 4 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@
if String($python::version) =~ /^python3/ {
$pip_package = "${python}-pip"
$pip_provider = $python.regsubst(/^.*python3\.?/,'pip3.').regsubst(/\.$/,'')
} elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '8') >= 0) {
} elsif $facts['os']['family'] == 'RedHat' {
$pip_package = 'python3-pip'
$pip_provider = pip3
} elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) {
$pip_package = 'python2-pip'
$pip_provider = pip2
} elsif $facts['os']['family'] == 'FreeBSD' {
$pip_package = "py${python::version}-pip"
$pip_provider = 'pip'
Expand Down
2 changes: 0 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
Expand Down
70 changes: 0 additions & 70 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,76 +265,6 @@
end
when 'RedHat', 'CentOS'
case facts[:os]['release']['major']
when '7'

context 'on a Redhat 7 OS' do
it { is_expected.to contain_class('python::install') }
it { is_expected.to contain_package('pip').with_name('python2-pip') }

describe 'with python::version' do
context 'python36' do
let(:params) { { version: 'python36' } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('pip').with_name('python36-pip') }
it { is_expected.to contain_package('python').with_name('python36') }
it { is_expected.to contain_package('python-dev').with_name('python36-devel') }
end
end

describe 'with manage_gunicorn' do
context 'true' do
let(:params) { { manage_gunicorn: true } }

it { is_expected.to contain_package('gunicorn').with_name('python-gunicorn') }
end

context 'empty args' do
# let(:params) {{ :manage_gunicorn => '' }}
it { is_expected.to contain_package('gunicorn').with_name('python-gunicorn') }
end

context 'false' do
let(:params) { { manage_gunicorn: false } }

it { is_expected.not_to contain_package('gunicorn') }
end
end

describe 'with python::provider' do
context 'scl' do
describe 'with version' do
context '3.6 SCL meta package' do
let(:params) { { version: 'rh-python36' } }

it { is_expected.to compile.with_all_deps }
end

context '3.6 SCL python package' do
let(:params) { { version: 'rh-python36-python' } }

it { is_expected.to compile.with_all_deps }
end
end

describe 'with manage_scl' do
context 'true' do
let(:params) { { provider: 'scl', manage_scl: true } }

it { is_expected.to contain_package('centos-release-scl') }
it { is_expected.to contain_package('scl-utils') }
end

context 'false' do
let(:params) { { provider: 'scl', manage_scl: false } }

it { is_expected.not_to contain_package('centos-release-scl') }
it { is_expected.not_to contain_package('scl-utils') }
end
end
end
end
end
when '8'
context 'on a Redhat 8 OS' do
it { is_expected.to contain_class('python::install') }
Expand Down

0 comments on commit de7d06e

Please sign in to comment.