Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit 2c160b8

Browse files
committed
Comply with style
1 parent b179bd2 commit 2c160b8

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

manifests/install.pp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# [*package*]
2222
# Name of the package to install (when install='package'). If not default it's
2323
# automatically defined for the operatingsystem
24-
# Default: ''
24+
# Default: undef
2525
#
2626
# [*package_source*]
2727
# Source from where to retrieve the defined package. Use a url.
@@ -44,8 +44,8 @@
4444
$version = '7',
4545
$headless = true,
4646
$install = 'package',
47-
$install_source = '',
48-
$package = '',
47+
$install_source = undef,
48+
$package = undef,
4949
$package_source = undef,
5050
$package_responsefile = undef,
5151
$package_provider = undef,
@@ -59,13 +59,12 @@
5959
case $install {
6060

6161
'package': {
62-
6362
$headless_suffix = $bool_headless ? {
6463
true => '-headless',
6564
default => '',
6665
}
6766
$real_package = $package ? {
68-
'' => $bool_jdk ? {
67+
undef => $bool_jdk ? {
6968
false => $::operatingsystem ? {
7069
/(?i:RedHat|Centos|Fedora|Scientific|Amazon|Linux)/ => "java-1.${version}.0-openjdk",
7170
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jre${headless_suffix}",
@@ -78,7 +77,7 @@
7877
},
7978
default => fail("OperatingSystem ${::operatingsystem} not supported"),
8079
},
81-
true => $::operatingsystem ? {
80+
true => $::operatingsystem ? {
8281
/(?i:RedHat|Centos|Fedora|Scientific|Amazon|Linux)/ => "java-1.${version}.0-openjdk-devel",
8382
/(?i:Ubuntu|Debian|Mint)/ => "openjdk-${version}-jdk",
8483
/(?i:SLES)/ => "java-1_${version}_0-ibm",
@@ -88,7 +87,7 @@
8887
'11' => "jdk-${version}",
8988
'5' => 'jdk',
9089
},
91-
default => fail("OperatingSystem ${::operatingsystem} not supported"),
90+
default => fail("OperatingSystem ${::operatingsystem} not supported"),
9291
}
9392
},
9493
default => $package,
@@ -105,9 +104,7 @@
105104
responsefile => $package_responsefile,
106105
provider => $package_provider,
107106
}
108-
109107
}
110-
111108
'source': {
112109
if (!$install_source) {
113110
fail('Required arguement: install_source')
@@ -130,10 +127,9 @@
130127
target => $created_dir,
131128
require => Puppi::Netinstall["netinstall_java_${name}"],
132129
}
133-
134130
}
135-
136-
default: { }
137-
131+
default: {
132+
fail("java::install::${name}::install is <${install}> and must be 'package' or 'source'.")
133+
}
138134
}
139135
}

manifests/params.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434

3535

3636
# Real package names are computed in java class
37-
$package = ''
38-
$package_jdk = ''
37+
$package = undef
38+
$package_jdk = undef
3939

4040
# General Settings
41-
$my_class = ''
41+
$my_class = undef
4242
$absent = false
4343
$puppi = false
4444
$puppi_helper = 'standard'

0 commit comments

Comments
 (0)