lib/facter/util/ip.rb in facter-1.6.18 vs lib/facter/util/ip.rb in facter-1.7.0.rc1

- old
+ new

@@ -3,12 +3,12 @@ module Facter::Util::IP # A map of all the different regexes that work for # a given platform or set of platforms. REGEX_MAP = { :linux => { - :ipaddress => /inet addr:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, - :ipaddress6 => /inet6 addr: ((?![fe80|::1])(?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/, + :ipaddress => /inet (?:addr:)?([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, + :ipaddress6 => /inet6 (?:addr: )?((?![fe80|::1])(?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/, :macaddress => /(?:ether|HWaddr)\s+((\w{1,2}:){5,}\w{1,2})/, :netmask => /Mask:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, :mtu => /MTU:(\d+)/ }, :bsd => { @@ -282,15 +282,8 @@ if ipaddress && netmask ip = IPAddr.new(ipaddress, Socket::AF_INET) subnet = IPAddr.new(netmask, Socket::AF_INET) network = ip.mask(subnet.to_s).to_s - end - end - - def self.get_arp_value(interface) - arp = Facter::Util::Resolution.exec("arp -en -i #{interface} | sed -e 1d") - if arp =~ /^\S+\s+\w+\s+(\S+)\s+\w\s+\S+$/ - return $1 end end end