lib/facter/util/ip.rb in facter-1.5.3 vs lib/facter/util/ip.rb in facter-1.5.4
- old
+ new
@@ -121,11 +121,11 @@
hwaddrre = /^Slave Interface: #{interface}\n[^\n].+?\nPermanent HW addr: (([0-9a-fA-F]{2}:?)*)$/m
value = hwaddrre.match(bondinfo.to_s)[1].upcase
else
output_int = get_single_interface_output(interface)
- if interface != "lo" && interface != "lo0"
+ if interface != /^lo[0:]?\d?/
output_int.each do |s|
if s =~ regex
value = $1
if label == 'netmask' && convert_from_hex?(kernel)
value = value.scan(/../).collect do |byte| byte.to_i(16) end.join('.')
@@ -148,9 +148,9 @@
netmask = get_interface_value(interface, "netmask")
if ipaddress && netmask
ip = IPAddr.new(ipaddress, Socket::AF_INET)
subnet = IPAddr.new(netmask, Socket::AF_INET)
- network = ip.mask(subnet.to_s)
+ network = ip.mask(subnet.to_s).to_s
end
end
end