Skip to content

Commit 74dd732

Browse files
committed
code polishing after lint check
1 parent 5d9408e commit 74dd732

4 files changed

Lines changed: 31 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##2015-04-22 - Release - 1.0.1
2+
###Summary
3+
Code polishing to be more compliant with puppet-lint suggestions.
4+
15
##2015-04-21 - Release - 1.0.0
26
###Summary
37
Initial release as PuppetForge module.

manifests/config.pp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,32 @@
55
#
66
# == Actions:
77
#
8-
# Sets up the default java according to the parameter <tt>java_default_version</tt> if it is not null.
8+
# Sets up the default java according to the parameter
9+
# <tt>java_default_version</tt> if it is not null.
910
#
1011
# == Requires:
1112
# none
1213
#
13-
define java::config ($java_version = $title, $java_default_version) {
14+
define java::config ($java_default_version, $java_version = $title,) {
1415
if $java_default_version != undef and $java_version == $java_default_version {
1516
case $::operatingsystem {
1617
'Ubuntu' : {
1718
case $::operatingsystemrelease {
1819
'10.04' : {
19-
$javadir = "/usr/lib/jvm/java-${$java_version}-openjdk/jre/bin/java"
20+
$javadir = "/usr/lib/jvm/java-${java_version}-openjdk/jre/bin/java"
2021
}
2122
'12.04' : {
22-
$javadir = "/usr/lib/jvm/java-${$java_version}-openjdk-${::architecture}/jre/bin/java"
23+
$javadir = "/usr/lib/jvm/java-${java_version}-openjdk-${::architecture}/jre/bin/java"
2324
}
2425
default : {
25-
fail("The ${module_name} module is not supported on ${::operatingsystem} release ${::operatingsystemrelease}")
26+
fail("The ${module_name} module is not supported on ${::operatingsystem} release ${::operatingsystemrelease}"
27+
)
2628
}
2729
}
2830
}
2931
default : {
30-
fail("The ${module_name} module is not supported on an ${::operatingsystem} distribution.")
32+
fail("The ${module_name} module is not supported on an ${::operatingsystem} distribution."
33+
)
3134
}
3235
}
3336

manifests/init.pp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,35 @@
44
#
55
# Parameters:
66
#
7-
# $java_version:: The java version. Possible values at this time are <tt>6</tt> and <tt>7</tt>.
7+
# $java_version:: The java version. Possible values at this time are
8+
# <tt>6</tt> and <tt>7</tt>.
89
# Defaults to the resource's title.
910
#
10-
# $java_default_version:: The java default version. Possible values at this time are <tt>6</tt> and <tt>7</tt>.
11-
# If different than +undef+ it will be used to configure the alternative system.
11+
# $java_default_version:: The java default version. Possible values at this time
12+
# are <tt>6</tt> and <tt>7</tt>.
13+
# If different than +undef+ it will be used to configure
14+
# the alternative system.
1215
# Defaults to +undef+.
1316
#
1417
# Actions:
1518
#
1619
# Declares all other defines in the java module needed for installing Java.
1720
# Currently, these consists of java::install, and java::config.
18-
# Furthermore, the module provides two classes ready for use for installing java-6 and java-7 using the defines.
19-
# If hiera defines a value for the parameter <tt>java_default_version</tt> on the target node the
20-
# command <tt>update-alternatives</tt> is issued to set the default java accordingly.
21+
# Furthermore, the module provides two classes ready for use for installing
22+
# java-6 and java-7 using the defines.
23+
# If hiera defines a value for the parameter <tt>java_default_version</tt> on
24+
# the target node the
25+
# command <tt>update-alternatives</tt> is issued to set the default java
26+
# accordingly.
2127
#
2228
# Requires: see Modulefile
2329
#
2430
# Sample Usage:
2531
#
2632
# java {'6': }
27-
define java ($java_version = $title, $java_default_version = hiera('java::java_default_version', undef)) {
33+
define java (
34+
$java_version = $title,
35+
$java_default_version = hiera('java::java_default_version', undef)) {
2836
java::install { $java_version:
2937
} -> java::config { $java_version:
3038
java_default_version => $java_default_version,

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"author": "Dario Sestero",
33
"dependencies": [],
4-
"license": "Creative Commons Attribution-Share Alike 4.0 International license (CC-BY-SA-4.0)",
4+
"license": "CC-BY-SA-4.0",
55
"name": "dsestero-java",
66
"project_page": "https://github.com/dsestero/java",
7-
"source": "ssh://git@github.com:dsestero/java.git",
7+
"source": "https://github.com/dsestero/java.git",
88
"summary": "Install Java OpenJDK and configure the default java alternative",
99
"requirements": [{"name": "puppet", "version_requirement": "3.x"}],
1010
"operatingsystem_support": [
@@ -14,5 +14,5 @@
1414
}
1515
],
1616
"tags": ["java", "jee", "jvm", "middleware"],
17-
"version": "1.0.0"
17+
"version": "1.0.1"
1818
}

0 commit comments

Comments
 (0)