Issue #6716 has been updated by Jacob Helwig. Status changed from Ready For Testing to Available In Testing Branch Assignee deleted (Nigel Kersten)
Slightly modified version merged as of commit:330d3992744b80187223e5b6af2a58219e4610f6 ---------------------------------------- Bug #6716: facter issues on OSX with ipv6 in macaddress.rb https://projects.puppetlabs.com/issues/6716 Author: Ben Hughes Status: Available In Testing Branch Priority: Normal Assignee: Category: library Target version: 1.5.9 Keywords: Branch: https://github.com/barn/facter/tree/tickets%2Fmaster%2F6716 Shocker I know, problems with macaddresses. facter/lib/facter/util/macaddress.rb: <pre> def self.default_interface `#{netstat_command} | /usr/bin/awk '/^default/{print $6}'`.chomp end </pre> Doesn't work for me, because I have more than one default interface, because I'm the guy using IPv6. Which means default_interface has a "\n" on the end, which means the: <pre> macaddress = `#{ifconfig_command} #{iface} | /usr/bin/awk '/ether/{print $2;exit}'`.chomp </pre> has a "\n" in the middle, so it errors badly and outputs weird things. This is due to: <pre> [ben@Paresthesia:facter]% netstat -rn | /usr/bin/awk '/^default/' default 192.168.1.254 UGSc 18 0 en1 default 2001:44b8:61::16e UGSc tun1 </pre> BUT! The second one doesn't have a 6th element, so an empty line gets thrown in. We could either/or: 1) "netstat -rn -f inet" which will assume IPv4 as the main IP stack.... 2) "/usr/bin/awk '/^default/ {print $6;exit;}'" only print the first interface with a default route. If IPv4 has no default route, then IPv6 will be used, thus keeping that one user happy. 3) some ugly removal of blank lines in the interface name (.chomp.chomp is what I've just written to test it, but that's hideous). 4) replacement ip/macaddress fact handling system. -- 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.
