Skip to content

Commit

Permalink
allow all python versions
Browse files Browse the repository at this point in the history
Fixes issue voxpupuli#448, "Impossible to use version number in Ubuntu 16.04"

1) It does not make sense to restrict the allowed python versions per
distribution. Newer distribution releases add new python versions and
you can add repositories containing backports.
2) The List was outdated.
  • Loading branch information
jradmacher committed Dec 6, 2018
1 parent 5e38e7a commit fe7758b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
}

$allowed_versions = concat(['system', 'pypy'], $valid_versions)
unless $version =~ Enum[$allowed_versions] {
fail("version needs to be within${allowed_versions}")
unless $version =~ Pattern[/\A(python)?[0-9](\.[0-9])+/,
/\Apypy\Z/, /\Asystem\Z/] {
fail("version needs to be pypy, system or a version string like '3.5' or 'python3.5)")
}

# Module compatibility check
Expand Down
3 changes: 2 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
$python = $::python::version ? {
'system' => 'python',
'pypy' => 'pypy',
default => "${python::version}", # lint:ignore:only_variable_string
/\A(python)?([0-9](\.[0-9])+)/ => "python${1}",
default => "python${python::version}",
}

$pythondev = $::osfamily ? {
Expand Down
7 changes: 1 addition & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
$gunicorn = 'absent'
$manage_gunicorn = true
$provider = undef
$valid_versions = $::osfamily ? {
'RedHat' => ['3','27','33'],
'Debian' => ['3', '3.3', '2.7'],
'Suse' => [],
'Gentoo' => ['2.7', '3.3', '3.4', '3.5']
}
$valid_versions = undef

if $::osfamily == 'RedHat' {
if $::operatingsystem != 'Fedora' {
Expand Down

0 comments on commit fe7758b

Please sign in to comment.