Skip to content

Commit

Permalink
Fix pyvenv on some operating systems
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Dec 23, 2020
1 parent 911daa0 commit de39e36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions manifests/pyvenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
ensure_packages($python3_venv_package)

Package[$python3_venv_package] -> File[$venv_dir]

case $facts['os']['distro']['codename'] {
'buster','bionic': {
$python3_distutils_package = "python${normalized_python_version}-distutils"
ensure_packages($python3_distutils_package)

Package[$python3_distutils_package] -> File[$venv_dir]
}
}
}

# pyvenv is deprecated since 3.6 and will be removed in 3.8
Expand Down
4 changes: 4 additions & 0 deletions spec/defines/pyvenv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
if %w[xenial bionic cosmic disco stretch buster].include?(facts[:lsbdistcodename])
it { is_expected.to contain_package('python3.5-venv').that_comes_before('File[/opt/env]') }
end

if %w[bionic buster].include?(facts[:lsbdistcodename])
it { is_expected.to contain_package('python3.5-distutils').that_comes_before('File[/opt/env]') }
end
end

describe 'when ensure' do
Expand Down

0 comments on commit de39e36

Please sign in to comment.