(#21533) Convert network data to string before access
Elias Probst authored 10 years ago
Adrien Thebo committed 10 years ago
25 | 25 |
def get_address_after_token(output, token, return_first=false)
|
26 | 26 |
ip = nil
|
27 | 27 |
|
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|
|
29 | 29 |
match = match.first
|
30 | 30 |
unless match =~ /fe80.*/ or match == "::1"
|
31 | 31 |
ip = match
|
28 | 28 |
ether = []
|
29 | 29 |
output = Facter::Util::IP.exec_ifconfig(["-a","2>/dev/null"])
|
30 | 30 |
|
31 | |
output.each_line do |s|
|
|
31 |
String(output).each_line do |s|
|
32 | 32 |
ether.push($1) if s =~ /(?:ether|HWaddr) ((\w{1,2}:){5,}\w{1,2})/
|
33 | 33 |
end
|
34 | 34 |
Facter::Util::Macaddress.standardize(ether[0])
|
24 | 24 |
}
|
25 | 25 |
end
|
26 | 26 |
|
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|
|
28 | 28 |
matches = line.match(ops[:regex])
|
29 | 29 |
if !matches.nil?
|
30 | 30 |
if ops[:munge].nil?
|