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