Issue #4986 has been reported by Jeremy Jack.
----------------------------------------
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.