replace validate_* calls with datatypes
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user