The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
Facter use exec + cat ( or exec = hostname ) when not needed
|Status:||Merged - Pending Release||Start date:||04/18/2011|
|Keywords:||Affected Facter version:|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.
In various place in the code, facter use Facter::Util::Resolution.exec while this could be avoided, most notably when reading file with cat. I have patches that I can split if needed to use either ruby functions ( for hostname ), or File::open.
#2 Updated by Ben Hughes about 3 years ago
- Status changed from Unreviewed to Accepted
Thank you for the patches!
The ones in /proc are deliberate I’m afraid due to a linux/ruby bug http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/155744
But I don’t believe the others to be, so thanks.
#3 Updated by Michael Scherer almost 3 years ago
The url speak of a 5 years old bug, and it seems to be fixed by using a newer kernel ( 2.6.13, according to the mail in the next mail of the thread ). I cannot reproduce the problem on my laptop, so there is maybe another reason ( or maybe it was the wrong reference ? ).
#8 Updated by Ken Barber over 2 years ago
- Status changed from In Topic Branch Pending Review to Code Insufficient
As Josh says – the use of cat for proc in virtual.rb has to stay. The other fixes are good – cheers. If you can remove that virtual.rb change and submit a pull request from your branch that would be great.
If you have some time – we would really like some test coverage for these cases as well :–). As currently we have no coverage which is not so great:
#10 Updated by Andrew Parker over 1 year ago
- Status changed from Code Insufficient to In Topic Branch Pending Review
- Target version set to 2.0.0
- Branch changed from https://github.com/mscherer/facter/tree/ticket/1.5.x/7138 to https://github.com/puppetlabs/facter/pull/266
This has been picked up again as part of performance work. We’ll put this in the 2.x codeline, which should help us get onto newer kernels and avoid the problems mentioned.