Issue #4986 has been updated by donavan m.
Jeremy, I think this is a dupe of Facter issue 1365. 1365 has been marked as closed against Facter 1.5.8, but personally I haven't verified that yet. The issue you're seeing is that Facter relies (relied?) on Rubys library autoloading. Because of that calling 'require foo' would autoload foo.rb, which would contain your 'foo' fact. If the requested fact 'bar' is in foo.rb you will see your observed behavior. Your workaround simply loads all facts in your library path. ---------------------------------------- Bug #4986: Facter Does Not Report Individual Facts Properly http://projects.puppetlabs.com/issues/4986 Author: Jeremy Jack Status: Unreviewed Priority: Normal Assignee: Category: Target version: Keywords: Branch: We have a few issues with Facter being unable to report individual facts properly. Take this, for example: dev-box:~# facter lsbdistdescription dev-box:~# facter | grep lsbdistdescription lsbdistdescription => Debian GNU/Linux 5.0.3 (lenny) dev-box:~# facter memoryfree dev-box:~# facter | grep memoryfree memoryfree => 390.38 MB Whereas this and nearly every other fact work: dev-box:~# facter rubysitedir /usr/local/lib/site_ruby/1.8 dev-box:~# facter facterversion 1.5.1 dev-box:~# facter kernelrelease 2.6.26-2-amd64 It appears that it's not properly loading the lsb facts, along with several others, when requested directly. For our internal builds of facter, I was able to get this to work as we'd expect by forcing Facter to load all facts first like this (line 123, /usr/bin/facter): 120 if names.empty? 121 facts = Facter.to_hash 122 else 123 Facter.loadfacts 124 facts = {} 125 names.each { |name| 126 begin 127 facts[name] = Facter.value(name) 128 rescue => error 129 STDERR.puts "Could not retrieve %s: #{error}" % name 130 exit 10 131 end 132 } 133 end Loading all facts to retrieve whatever is in ARGV seems a bit excessive and, depending on the facts on that machine, can take a long time. Was there some magic that I'm missing that would allow Facter to just load an individual fact, or is this a sane fix? -- 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.
