diff --git a/manifests/pyvenv.pp b/manifests/pyvenv.pp index 269cf69c..7abc33d3 100644 --- a/manifests/pyvenv.pp +++ b/manifests/pyvenv.pp @@ -49,6 +49,13 @@ ensure_packages($python3_venv_package) Package[$python3_venv_package] -> File[$venv_dir] + + if $facts['os']['distro']['codename'] in ['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 diff --git a/spec/defines/pyvenv_spec.rb b/spec/defines/pyvenv_spec.rb index 36452839..9492a6f7 100644 --- a/spec/defines/pyvenv_spec.rb +++ b/spec/defines/pyvenv_spec.rb @@ -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