Issue #6716 has been updated by Michael Knox.
I have just test 1.5.9rc1 and found that I have a similar issue, but with ipv4
only.
dhcp-au-68:facter mike$ RUBYLIB=`pwd`/lib bin/facter macaddress
sh: line 1: en1: command not found
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether <ether>
inet <ipv4 address> netmask 0xffffff80 broadcast <ipv4 netmask>
media: autoselect (1000baseT <full-duplex,flow-control>)
status: active
dhcp-au-68:facter mike$
----------------------------------------
Bug #6716: facter issues on OSX with ipv6 in macaddress.rb
https://projects.puppetlabs.com/issues/6716
Author: Ben Hughes
Status: Needs Decision
Priority: Normal
Assignee:
Category:
Target version:
Keywords:
Branch:
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.