Skip to content

Commit de39e36

Browse files
committedDec 23, 2020
Fix pyvenv on some operating systems
1 parent 911daa0 commit de39e36

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
 

‎manifests/pyvenv.pp

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
ensure_packages($python3_venv_package)
5050

5151
Package[$python3_venv_package] -> File[$venv_dir]
52+
53+
case $facts['os']['distro']['codename'] {
54+
'buster','bionic': {
55+
$python3_distutils_package = "python${normalized_python_version}-distutils"
56+
ensure_packages($python3_distutils_package)
57+
58+
Package[$python3_distutils_package] -> File[$venv_dir]
59+
}
60+
}
5261
}
5362

5463
# pyvenv is deprecated since 3.6 and will be removed in 3.8

‎spec/defines/pyvenv_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
if %w[xenial bionic cosmic disco stretch buster].include?(facts[:lsbdistcodename])
2222
it { is_expected.to contain_package('python3.5-venv').that_comes_before('File[/opt/env]') }
2323
end
24+
25+
if %w[bionic buster].include?(facts[:lsbdistcodename])
26+
it { is_expected.to contain_package('python3.5-distutils').that_comes_before('File[/opt/env]') }
27+
end
2428
end
2529

2630
describe 'when ensure' do

0 commit comments

Comments
 (0)