20 Commits

Author SHA1 Message Date
Helen Campbell
891b70a7c6 pdksync_heads/master-0-g34e3266 2018-05-18 15:21:46 +01:00
Will Meek
dec5136e11 Cleanup ruby code via rubocop
This commit will add code cleanup as corrected
and alerted by rubocop. It also adds rules to
execute rubocop on Travis.
2017-11-21 14:31:45 +00:00
Will Meek
e1df6498c7 Fix facter unit test when using realpath 2017-11-15 14:37:42 +00:00
Sebastian Reitenbach
e50eb64614 do not use unportable readlink utility to find the java_default_home,
use Ruby in a more portable fashion.

adapt tests as well
2017-11-15 14:37:42 +00:00
Sebastian Reitenbach
bdfc567c18 OpenBSD doesn't have /etc/environment, therefore there is no
need to fiddle with it. The default case statement, "do nothing"
is all fine here.

Facter::Util::Resolution.with_env is long time gone since
Facter > 2.x. That was even longer before introduced by me.
Remove that OpenBSD special case in the java_version fact,
and assume that $PATH is properly set in order to find
the 'java' binary.

Additionally confine the java_default_home and java_libjvm_path
to OpenBSD kernel as well. Add some flesh to the java_default_home
fact to allow it to find the java binary.
2017-11-15 14:37:42 +00:00
shuebnersr
b7bdf96252 Fixed search for matching line with java version
Use value of variable instead of return statement
Extended unit test for checking handling of JAVA_TOOL_OPTIONS
2017-10-01 15:15:01 +02:00
shuebnersr
d89532435d search for matching line with java version
do not just try to read java version from first line, but search for the matching line from java output
2017-09-20 14:26:04 +02:00
Hunter Haugen
49369bd48c Merge pull request #215 from vrtdev/bugfix/MODULES-4368-java_default_home-invalid-fact
See: https://tickets.puppetlabs.com/browse/MODULES-4368
2017-06-07 16:15:47 -07:00
Vadym Chepkov
797677caf7 [MODULES-4736] Increase Xmx setting for java_version fact
Previous value of 8M caused JVM to crash on servers with more then 40G of RAM
Tested on databases servers up to 1.5T of RAM, 12M seems to be sufficient
2017-04-19 07:47:07 -04:00
Jan Vansteenkiste
c0227ce820 MODULES-4368: return nil if java_bin is not found (readlink result is empty) 2017-02-01 08:10:59 +01:00
Jan Vansteenkiste
b5b03e5c00 (MODULES-4050) Check if jre is in the path before subsubdir 2016-11-07 16:06:36 +01:00
Fabien Wernli
9c154890a3 add two facts: java_libjvm_path java_default_home
* dirname containing base directory of java
* e.g. java binary is `${::java_default_home}/jre/bin/java`

* dirname containing `libjvm.so`
* Most people will use this for LD_LIBRARY_PATH
2015-12-01 12:13:11 +01:00
David Schmitt
dadc7a6c22 (MODULES-2637) Checks java actually installed
The other method for running which java doesn't work on OSX, as java is installed as an empty shim when not installed in the base OSX image:

```
vagrant:~ vagrant$ java
No Java runtime present, requesting install.
vagrant:~ vagrant$ /usr/libexec/java_home --failfast
Unable to find any JVMs matching version "(null)".
vagrant:~ vagrant$
```

We can use the `/usr/libexec/java_home --failfast` command to check if
java is actually present first.

Originally-by: Peter Souter <peter.souter@puppetlabs.com>
2015-10-01 19:09:32 +01:00
Sebastian Reitenbach
5815242f8e Add support for OpenBSD, and also add some regression tests.
Add info about OpenBSD support to README.md and metadata.json
Add a note about OpenBSD java_version fact to README.markdown.
Fixup wording on context in one of the java patch level regression tests.
No mentioning of OpenBSD in metdata.json

Cleanup wording of context as suggested by @elyscape
update contexts as suggested by @elyscape
2015-04-23 12:29:11 +02:00
Eli Young
8dd715a599 Improve java_version fact maintainability 2015-02-09 15:26:53 -08:00
Oliver Falk
79805000cc (MODULES-1749) Update java_version fact...
with maximum memory size

Add -Xmx8m to make large systems happy.
2015-02-06 12:47:23 +00:00
Peter Souter
cd3ac1ee46 (MODULES-1570) Add java_major_version fact
Gives the major version of the Java release (ie. Java 1.7.0_71, major version is 7)

We also want to specifically return nil when java not present
2015-01-07 15:42:23 -08:00
Peter Souter
5168f61c26 (MODULES-1570) Improve variable names
Lets keep it vaguely consistent
2014-12-29 15:13:47 +00:00
Peter Souter
ea4717ea29 (MODULES-1570) java_patch_level fact
Uses the `java_version` fact and gets the patch level by splitting after `_`

This would be useful if you want to make sure you're not accidentally downgrading the version of Java to a lower patch level (I've noticed some package managers don't notice this too well)
2014-12-29 15:13:47 +00:00
Peter Souter
8724592f2b (MODULES-1570) java_version fact
Adapted from the many found on Github, simply runs `java -version` and strips the results. From what I can find there aren't many edge cases for the result `java -version 2>&1` could return, so this should be fairly compatible.
2014-12-29 15:13:47 +00:00