we need to check if java_default_home has a value before we attempt to find libjvm.so, otherwise we search the entire filesystem

This commit is contained in:
Robert Brooks
2019-09-26 09:57:55 -07:00
parent a5aad36b86
commit d4e5461c26

View File

@@ -14,7 +14,9 @@ Facter.add(:java_libjvm_path) do
confine kernel: ['Linux', 'OpenBSD']
setcode do
java_default_home = Facter.value(:java_default_home)
if java_default_home
java_libjvm_file = Dir.glob("#{java_default_home}/**/lib/**/libjvm.so")
end
if java_libjvm_file.nil? || java_libjvm_file.empty?
nil
else