Resolution.exec used to ensure that any shell errors are suppressed.

Signed-off-by: Rein Henrichs <[email protected]>
---
 lib/facter/util/uptime.rb |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/facter/util/uptime.rb b/lib/facter/util/uptime.rb
index 6c60ace..9a59d30 100644
--- a/lib/facter/util/uptime.rb
+++ b/lib/facter/util/uptime.rb
@@ -19,19 +19,19 @@ module Facter::Util::Uptime
     private
 
     def self.uptime_proc_uptime
-        if output = `/bin/cat #{uptime_file} 2>/dev/null` and $?.success?
+        if output = Facter::Util::Resolution.exec("/bin/cat #{uptime_file} 
2>/dev/null")
             output.chomp.split(" ").first.to_i
         end
     end
 
     def self.uptime_sysctl
-        if output = `#{uptime_sysctl_cmd} 2>/dev/null` and $?.success?
+        if output = Facter::Util::Resolution.exec("#{uptime_sysctl_cmd} 
2>/dev/null")
             compute_uptime(Time.at(output.unpack('L').first))
         end
     end
 
     def self.uptime_who_dash_b
-        if output = `#{uptime_who_cmd} 2>/dev/null` and $?.success?
+        if output = Facter::Util::Resolution.exec("#{uptime_who_cmd} 
2>/dev/null")
             compute_uptime(Time.parse(output))
         end
     end
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to