Re: [Puppet-dev] [PATCH/facter 1/1] [#2330] Uptime should not make redundant system calls

2010-08-04 Thread Paul Nasrat
On 3 August 2010 23:03, Rein Henrichs r...@puppetlabs.com wrote: From: Rein Henrichs re...@reinh.com Rewrite of uptime facts and supporting utility methods. Works on unix, BSD, windows. No longer makes redundant system calls. Uses Facter::Util::Uptime utility methods: Thanks for this, not

Re: [Puppet-dev] [PATCH/facter 1/1] [#2330] Uptime should not make redundant system calls

2010-08-04 Thread Paul Berry
On Wed, Aug 4, 2010 at 5:02 AM, Paul Nasrat pnas...@gmail.com wrote: +def self.uptime_proc_uptime +if File.exists? uptime_file +r = File.read uptime_file +r.split( ).first.to_i +end +end snip end -def self.get_uptime -

Re: [Puppet-dev] [PATCH/facter 1/1] [#2330] Uptime should not make redundant system calls

2010-08-04 Thread Rein Henrichs
Excerpts from Paul Berry's message of Wed Aug 04 08:43:54 -0700 2010: On Wed, Aug 4, 2010 at 5:02 AM, Paul Nasrat pnas...@gmail.com wrote: You've moved to read from cat, that'll likely break on RHEL 4 see Correct me if I'm wrong, but it looks like the core problem is that reading from /proc

[Puppet-dev] [PATCH/facter 1/1] [#2330] Uptime should not make redundant system calls

2010-08-03 Thread Rein Henrichs
From: Rein Henrichs re...@reinh.com Rewrite of uptime facts and supporting utility methods. Works on unix, BSD, windows. No longer makes redundant system calls. Uses Facter::Util::Uptime utility methods: * Implemented uptime_seconds_unix using /proc/uptime or who -b on unix, sysctl on BSD.