Skip to content

Commit

Permalink
replace validate_* calls with datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 30, 2017
1 parent 071405e commit 9b532c3
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions manifests/init.pp
Expand Up @@ -46,22 +46,16 @@
# Sample Usage:
#
class java(
$distribution = 'jdk',
$version = 'present',
$package = undef,
$package_options = undef,
$java_alternative = undef,
$java_alternative_path = undef,
$java_home = undef
String $distribution = 'jdk',
Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present',
$package = undef,
Optional[Array] $package_options = undef,
$java_alternative = undef,
$java_alternative_path = undef,
$java_home = undef
) {
include java::params

validate_re($version, 'present|installed|latest|^[.+_0-9a-zA-Z:~-]+$')

if $package_options != undef {
validate_array($package_options)
}

if has_key($java::params::java, $distribution) {
$default_package_name = $java::params::java[$distribution]['package']
$default_alternative = $java::params::java[$distribution]['alternative']
Expand Down

0 comments on commit 9b532c3

Please sign in to comment.