Skip to content

Commit

Permalink
Update version validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit authored and krissik committed Jul 30, 2020
1 parent e87db52 commit 598558b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# @example install python3 from scl repo
# class { 'python' :
# ensure => 'present',
# version => 'rh-python36-python',
# version => 'rh-python36',
# dev => 'present',
# virtualenv => 'present',
# }
Expand Down Expand Up @@ -64,7 +64,7 @@
}

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

Expand Down
7 changes: 4 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

$python_version = getparam(Class['python'], 'version')
$python = $python_version ? {
'system' => 'python',
'pypy' => 'pypy',
'system' => 'python',
'pypy' => 'pypy',
/\A(python)?([0-9](\.?[0-9])+)/ => "python${2}",
default => "python${python::version}",
/\Arh-python[0-9]{2}/ => $python_version,
default => "python${python::version}",
}

$pythondev = $facts['os']['family'] ? {
Expand Down

0 comments on commit 598558b

Please sign in to comment.