forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update java to 5b6470acf6ee284ed039e67703df63acb545e8a5
5b6470acf6ee284ed039e67703df63acb545e8a5 Merge remote-tracking branch 'upstream/1.4.x' 4764484970d0b27d0daeaddce5d39527d27d21b7 Merge pull request redhat-openstack#117 from ccin2p3/f/libjvm_fact 9c154890a363be10a9ba6e09630f3c69008d670b add two facts: java_libjvm_path java_default_home a65d69a85de13e75557e56151f82f0fb3207cc52 Merge pull request redhat-openstack#148 from tphoney/release_1.4.3 1c1d0b6cb7687ea0f4ca5074065635c4f3d0104a 1.4.3 release prep 4f0ee5a75975df27513ac257cca1f9278c4c2b7f Merge pull request redhat-openstack#147 from oc243/patch-2 ca2171043ee2f73c5e43c8adf59e72b52c91ebe2 Add support for Ubuntu 15.10 1236d9ee474da4ef342fae64e243998cf50678da Merge pull request redhat-openstack#145 from bmjen/git-fixtures de05057e1d240dc7e68f79eefa15a628fcaca3b8 update fixtures.yml to use git instead of http Change-Id: I3d3fddf66b94892672cf71f1926f775f6bef5aa4
- Loading branch information
Showing
9 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Fact: java_default_home | ||
# | ||
# Purpose: get absolute path of java system home | ||
# | ||
# Resolution: | ||
# Uses `readlink` to resolve the path of `/usr/bin/java` then returns subsubdir | ||
# | ||
# Caveats: | ||
# Requires readlink | ||
# | ||
# Notes: | ||
# None | ||
Facter.add(:java_default_home) do | ||
confine :kernel => 'Linux' | ||
setcode do | ||
if Facter::Util::Resolution.which('readlink') | ||
java_bin = Facter::Util::Resolution.exec('readlink -e /usr/bin/java').strip | ||
java_default_home = File.dirname(File.dirname(File.dirname(java_bin))) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Fact: java_libjvm_path | ||
# | ||
# Purpose: get path to libjvm.so | ||
# | ||
# Resolution: | ||
# Lists file in java default home and searches for the file | ||
# | ||
# Caveats: | ||
# Needs to list files recursively. Returns the first match | ||
# | ||
# Notes: | ||
# None | ||
Facter.add(:java_libjvm_path) do | ||
confine :kernel => "Linux" | ||
setcode do | ||
java_default_home = Facter.value(:java_default_home) | ||
java_libjvm_file = Dir.glob("#{java_default_home}/jre/lib/**/libjvm.so") | ||
if java_libjvm_file.nil? || java_libjvm_file.empty? | ||
nil | ||
else | ||
File.dirname(java_libjvm_file[0]) | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ | |
}, | ||
} | ||
} | ||
'vivid': { | ||
'vivid', 'wily': { | ||
$java = { | ||
'jdk' => { | ||
'package' => 'openjdk-8-jdk', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require "spec_helper" | ||
|
||
describe Facter::Util::Fact do | ||
before { | ||
Facter.clear | ||
Facter.fact(:kernel).stubs(:value).returns('Linux') | ||
} | ||
|
||
describe "java_default_home" do | ||
context 'returns java home path when readlink present' do | ||
it do | ||
java_path_output = <<-EOS | ||
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java | ||
EOS | ||
Facter::Util::Resolution.expects(:which).with("readlink").returns(true) | ||
Facter::Util::Resolution.expects(:exec).with("readlink -e /usr/bin/java").returns(java_path_output) | ||
Facter.value(:java_default_home).should == "/usr/lib/jvm/java-7-openjdk-amd64" | ||
end | ||
end | ||
|
||
context 'returns nil when readlink not present' do | ||
it do | ||
Facter::Util::Resolution.stubs(:exec) | ||
Facter::Util::Resolution.expects(:which).with("readlink").at_least(1).returns(false) | ||
Facter.value(:java_default_home).should be_nil | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "spec_helper" | ||
|
||
describe Facter::Util::Fact do | ||
before { | ||
Facter.clear | ||
Facter.fact(:kernel).stubs(:value).returns('Linux') | ||
java_default_home = '/usr/lib/jvm/java-8-openjdk-amd64' | ||
Facter.fact(:java_default_home).stubs(:value).returns(java_default_home) | ||
Dir.stubs(:glob).with("#{java_default_home}/jre/lib/**/libjvm.so").returns( ['/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so']) | ||
} | ||
|
||
describe "java_libjvm_path" do | ||
context 'returns libjvm path' do | ||
context 'on Linux' do | ||
it do | ||
Facter.value(:java_libjvm_path).should == "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server" | ||
end | ||
end | ||
end | ||
end | ||
end |