|
37 | 37 |
|
38 | 38 | if $ensure == 'present' { |
39 | 39 | $python_version = $version ? { |
40 | | - 'system' => "$::python3_version", |
41 | | - default => "${version}", |
| 40 | + 'system' => $facts['python3_version'], |
| 41 | + default => $version, |
42 | 42 | } |
43 | 43 |
|
44 | 44 | # Debian splits the venv module into a seperate package |
45 | 45 | if ( $facts['os']['family'] == 'Debian'){ |
46 | 46 | $python3_venv_package="python${python_version}-venv" |
47 | | - case $facts['os']['distro']['codename'] { |
48 | | - 'xenial','bionic','cosmic','disco', |
| 47 | + case $facts['lsbdistcodename'] { |
| 48 | + 'xenial','bionic','cosmic','disco', |
49 | 49 | 'jessie','stretch','buster': { |
50 | 50 | package {$python3_venv_package: |
51 | 51 | before => File[$venv_dir], |
|
56 | 56 | } |
57 | 57 |
|
58 | 58 | # pyvenv is deprecated since 3.6 and will be removed in 3.8 |
59 | | - if (versioncmp($::python3_version, '3.6') >=0) { |
| 59 | + if (versioncmp($facts['python3_version'], '3.6') >=0) { |
60 | 60 | $virtualenv_cmd = "${python::exec_prefix}python${python_version} -m venv" |
61 | 61 | } else { |
62 | 62 | $virtualenv_cmd = "${python::exec_prefix}pyvenv-${python_version}" |
|
0 commit comments