Skip to content

Commit

Permalink
Remove ensure-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zipkid committed Sep 13, 2023
1 parent 8881c43 commit 4edb99f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
case $python::provider {
'pip': {
if $python::manage_pip_package {
ensure_packages (['pip'],
package { 'pip':
ensure => $python::pip,
require => Package['python'],
)
}
}

if $pythondev {
ensure_packages (['python-dev'],
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
)
}
}

# Respect the $python::pip setting
Expand Down Expand Up @@ -180,28 +180,28 @@
}

if $pythondev {
ensure_packages (['python-dev'],
ensure => $python::dev,
name => $pythondev,
alias => $pythondev,
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
alias => $pythondev,
provider => 'yum',
)
}
}
}
default: {
if $python::manage_pip_package {
ensure_packages (['pip'],
package { 'pip':
ensure => $python::pip,
require => Package['python'],
)
}
}

if $pythondev {
ensure_packages (['python-dev'],
package { 'python-dev':
ensure => $python::dev,
name => $pythondev,
alias => $pythondev,
)
}
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
{
manage_pip_package: true,
manage_venv_package: true,
pip: 'installed',
venv: 'installed'
pip: 'present',
venv: 'present'
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('pip').with(ensure: 'installed') }
it { is_expected.to contain_package('pip').with(ensure: 'present') }

it { is_expected.to contain_package('python-venv').with(ensure: 'installed') } unless facts[:os]['name'] == 'CentOS'
it { is_expected.to contain_package('python-venv').with(ensure: 'present') } unless facts[:os]['name'] == 'CentOS'
end

case facts[:os]['family']
Expand Down Expand Up @@ -86,10 +86,10 @@
# rubocop:disable RSpec/RepeatedExampleGroupDescription
describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'installed' } }
let(:params) { { dev: 'present' } }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python-dev').with_ensure('installed') }
it { is_expected.to contain_package('python-dev').with_ensure('present') }
end

context 'empty/default' do
Expand Down Expand Up @@ -233,9 +233,9 @@

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'installed' } }
let(:params) { { dev: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('installed') }
it { is_expected.to contain_package('python-dev').with_ensure('present') }
end

context 'default/empty' do
Expand Down Expand Up @@ -417,9 +417,9 @@

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'installed' } }
let(:params) { { dev: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('installed') }
it { is_expected.to contain_package('python-dev').with_ensure('present') }
end

context 'empty/default' do
Expand Down Expand Up @@ -467,9 +467,9 @@

describe 'with python::dev' do
context 'true' do
let(:params) { { dev: 'installed' } }
let(:params) { { dev: 'present' } }

it { is_expected.to contain_package('python-dev').with_ensure('installed') }
it { is_expected.to contain_package('python-dev').with_ensure('present') }
end

context 'default/empty' do
Expand Down

0 comments on commit 4edb99f

Please sign in to comment.