Skip to content

Commit

Permalink
Merge pull request #677 from JakeTRogers/redhat_venv
Browse files Browse the repository at this point in the history
apply python-venv exclude to RedHat family instead of just CentOS
  • Loading branch information
kenyon authored Nov 28, 2023
2 parents 4a4c467 + 4e144a1 commit ad29652
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
##
## CentOS has no extra package for venv
##
unless $facts['os']['name'] == 'CentOS' {
unless $facts['os']['family'] == 'RedHat' {
package { 'python-venv':
ensure => $python::venv,
name => "${python}-venv",
Expand Down
28 changes: 28 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"7100-05-03-1837"
]
},
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
Expand Down Expand Up @@ -52,6 +59,27 @@
"20.04"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
it { is_expected.to contain_package('pip') }
end

if %w[Archlinux CentOS].include?(facts[:os]['name'])
if %w[Archlinux RedHat].include?(facts[:os]['family'])
it { is_expected.not_to contain_package('python-venv') }
else
it { is_expected.to contain_package('python-venv') }
Expand Down Expand Up @@ -60,7 +60,7 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('pip').with(ensure: 'present') }

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

case facts[:os]['family']
Expand Down

0 comments on commit ad29652

Please sign in to comment.