Issue #11441 has been updated by Jisakiel Kiel.

Just for the record, the usage of 10.3 / 10.4 is inherited: remote sites 
without remote management and with 10.3 installed (ppc), difficult to upgrade. 
Ruby 1.8.6 is the latest supported 10.3 version from rubyosx for 10.3 

Still believe that the objects returned by exec should probably be checked 
before access; I will try to have a glance and send patches if I find the time. 
That should make it somewhat more robust... 
----------------------------------------
Bug #11441: Facter issues on OSX (caused by: util:resolution:exec results not 
checked for nil results)
https://projects.puppetlabs.com/issues/11441

Author: Jisakiel Kiel
Status: Closed
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Keywords: osx, 10.3
Branch: 
Affected Facter version: 1.6.4


facter crashes not reporting anything on 10.3 PPC, with the following error: 

    second level name swapusage in vm.swapusage is invalid
    Error: undefined method `empty?' for nil:NilClass

"sysctl vm.swapusage" returns that error. sysctl vm returns only "vm.loadavg". 
The same error shows calling several facter modules as well (for instance 
"facter processorcount", but not "facter operatingsystemrelease"). 

Affected line is in lib/memory.rb:43 btw: 
    
    swap = Facter::Util::Resolution.exec('sysctl vm.swapusage')
    swaptotal = 0
    if swap =~ /total = (\S+)/ then swaptotal = $1; end

from util/resolution.rb: 
    # Returns nil if the program can't be found, or if there is a problem
    # executing the code.
    
swap should be checked before trying to access it with =~. There are probably 
other similar bugs scattered around exec calls (for instance in 
processor.rb)... 


OS is 10.3.9 (as reported by sw_vers); full uname is Darwin $hostname 7.9.0 
Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; 
root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc . Ruby is 
1.8.6 from rubyosx project, and rubygems is updated to 1.3.6. 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en.

Reply via email to