Issue #13396 has been updated by Stefan Schulte.
Krzysztof Wilczynski wrote: > > I don't like work-around problems like that :) > > Perhaps its the time to include simple "which" in Util in Facter? > > Quick tackle: https://gist.github.com/2205072 > > KW Most facts handle this by just letting the shell do the job. So to be consistent with other facts this is a possible fix <pre> - output = %x{/sbin/ifconfig} + output = Facter::Util::Resolution.exec('ifconfig -a') </pre> But I generally don't like two things about this approach - we rely on the PATH variable so the code may break if you run this as a non-root user or if you have `.` in path and running facter in the wrong directory - for each command we want to execute we do a second shell invocation to run `which $command` just to check if we find an executeable. I personally like the idea of implementing our own which command in pure ruby (and maybe with a fixed array of paths where we expect to find the executable). ---------------------------------------- Bug #13396: Facter not working with recent net-tools https://projects.puppetlabs.com/issues/13396#change-59736 Author: Stefan Schulte Status: Accepted Priority: High Assignee: Category: Target version: Keywords: Branch: Affected Facter version: Facter does not work at all with recent net-tools package on gentoo (and probably other OS as well) <pre> # facter Error: No such file or directory - /sbin/ifconfig -a # </pre> puppet therefore also does not work anymore <pre> # puppet apply -v -e 'notify { "Hello World": }' Could not run: Could not retrieve facts for host.example.com: No such file or directory - /sbin/ifconfig -a </pre> `sys-apps/net-tools-1.60_p20111120203157` does work while `sys-apps/net-tools-1.60_p20120127084908` (latest in portage tree) does not. I found the following commit in the net-tools repository that is causing the error. Apperently `ifconfig` has moved to `/bin` so facter does not find it anymore. <pre> commit 36b541c9f3efe55c5871674ee926be8b20339497 Author: Mike Frysinger <[email protected]> Date: Fri Dec 2 16:19:08 2011 -0500 ifconfig/route: move to /bin These tools provide quite a bit of good information which is available to non-root users, so let's move them to /bin for people to use. Signed-off-by: Mike Frysinger &[email protected]> </pre> Current workaround: Create a symlink from `/sbin/ifconfig` to `/bin/ifconfig` -- 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.
