Hi all.

I've got this fact, trying to use it with the munin module from DavidS 
to work out which drives to graph. Fairly run of the mill, but when ever 
I add this in to my facter folder. Puppet barfs with a Timeout::Error

[r...@foo-vm:~]# invoke-rc.d puppet start
Starting puppet configuration management tool
info: Loading fact whatraid
info: Loading fact localdisks
/usr/lib/ruby/1.8/timeout.rb:60: execution expired (Timeout::Error)
        from /var/lib/puppet/lib/facter/localdisks.rb:20:in `open'
        from /var/lib/puppet/lib/facter/localdisks.rb:20
        from /usr/lib/ruby/1.8/facter/util/fact.rb:38:in `instance_eval'
        from /usr/lib/ruby/1.8/facter/util/fact.rb:38:in `add'


The fact (yeah it's ugly...):

Facter.add("localdisks") do

        disks = [ ]
        File.open( "/proc/mounts" , "r" ) do |f|
                f.each do |line|
                        foo = line.chomp!.split("\s")
                        matchey = foo[0].match(/^\/dev\/([a-z0-9\/]+)[0-9]/)
                        disks.push(matchey[1]) unless matchey.nil?
                end
        end

        setcode do
                disks.uniq.join(',')
        end
end

However, from the command line with facter, it works:
[r...@foo-vm:~]# FACTERLIB=/var/lib/puppet/lib/facter/ facter  localdisks
sda


So I'm a little confused. What have I done painfully wrong? ):

-- 
Ben Hughes - MindCandy
-- 
Mind Candy Ltd, Registered in England: 05119483, Registered office: 41 Welbeck 
Street, London, W1G 8EA, UK

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to