Codebase list facter / d49f646
(#21533) Convert network data to string before access Elias Probst authored 10 years ago Adrien Thebo committed 10 years ago
3 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2525 def get_address_after_token(output, token, return_first=false)
2626 ip = nil
2727
28 output.scan(/#{token} ((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
28 String(output).scan(/#{token} ((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
2929 match = match.first
3030 unless match =~ /fe80.*/ or match == "::1"
3131 ip = match
2828 ether = []
2929 output = Facter::Util::IP.exec_ifconfig(["-a","2>/dev/null"])
3030
31 output.each_line do |s|
31 String(output).each_line do |s|
3232 ether.push($1) if s =~ /(?:ether|HWaddr) ((\w{1,2}:){5,}\w{1,2})/
3333 end
3434 Facter::Util::Macaddress.standardize(ether[0])
2424 }
2525 end
2626
27 Facter::Util::IP.exec_ifconfig(ops[:ifconfig_opts]).split(/\n/).collect do |line|
27 String(Facter::Util::IP.exec_ifconfig(ops[:ifconfig_opts])).split(/\n/).collect do |line|
2828 matches = line.match(ops[:regex])
2929 if !matches.nil?
3030 if ops[:munge].nil?