From 06eb3f57f48a57881e8dadc19714366eed5add18 Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Tue, 29 Mar 2011 13:38:44 +1100 Subject: (#6883) Update Facter install.rb to be slightly more informative. Give slightly more information to the user when installing facter and the pre-requisite Ruby libraries are not installed. In the case of OpenSSL, the user can have OpenSSL installed, and not the gem/library, but the error message given in no way hints to this. --- install.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.rb b/install.rb index eb91e7c..d4793eb 100755 --- a/install.rb +++ b/install.rb @@ -119,7 +119,7 @@ def check_prereqs begin require pre rescue LoadError - puts "Could not load %s; cannot install" % pre + puts "Could not load #{pre} Ruby library; cannot install" exit -1 end } -- cgit From 19f96b59081558eefd613770fdf8c5f5665a150b Mon Sep 17 00:00:00 2001 From: Ben Hughes Date: Thu, 7 Apr 2011 11:33:09 +1000 Subject: (#6728) Facter improperly detects openvzve on CloudLinux systems Make the openvz check for more than just the vz directory to be sure it's OpenVZ. Update the OpenVZ fact to be slightly more resilient in it's checking of OpenVZ, so it doesn't clash with CloudLinux's LVE container system. --- lib/facter/util/virtual.rb | 2 +- spec/unit/util/virtual_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/facter/util/virtual.rb b/lib/facter/util/virtual.rb index 4355451..8bdde16 100644 --- a/lib/facter/util/virtual.rb +++ b/lib/facter/util/virtual.rb @@ -1,6 +1,6 @@ module Facter::Util::Virtual def self.openvz? - FileTest.directory?("/proc/vz") + FileTest.directory?("/proc/vz") and FileTest.exists?( '/proc/vz/veinfo' ) end def self.openvz_type diff --git a/spec/unit/util/virtual_spec.rb b/spec/unit/util/virtual_spec.rb index aa2de5a..36e1bf1 100644 --- a/spec/unit/util/virtual_spec.rb +++ b/spec/unit/util/virtual_spec.rb @@ -9,6 +9,7 @@ describe Facter::Util::Virtual do end it "should detect openvz" do FileTest.stubs(:directory?).with("/proc/vz").returns(true) + FileTest.stubs(:exists?).with("/proc/vz/veinfo").returns(true) Facter::Util::Virtual.should be_openvz end -- cgit