lib/ohai/plugins/openbsd/network.rb in ohai-8.10.0 vs lib/ohai/plugins/openbsd/network.rb in ohai-8.11.1
- old
+ new
@@ -56,11 +56,11 @@
iface[cint][:addresses][$1] = { "family" => "lladdr" }
end
if line =~ /\s+inet ([\d.]+) netmask ([\da-fx]+)\s*\w*\s*([\d.]*)/
iface[cint][:addresses] = Mash.new unless iface[cint][:addresses]
# convert the netmask to decimal for consistency
- netmask = "#{$2[2,2].hex}.#{$2[4,2].hex}.#{$2[6,2].hex}.#{$2[8,2].hex}"
+ netmask = "#{$2[2, 2].hex}.#{$2[4, 2].hex}.#{$2[6, 2].hex}.#{$2[8, 2].hex}"
if $3.empty?
iface[cint][:addresses][$1] = { "family" => "inet", "netmask" => netmask }
else
# found a broadcast address
iface[cint][:addresses][$1] = { "family" => "inet", "netmask" => netmask, "broadcast" => $3 }
@@ -74,11 +74,11 @@
#found a zone_id / scope
iface[cint][:addresses][$1] = { "family" => "inet6", "zoneid" => $2, "prefixlen" => $3, "scopeid" => $4 }
end
end
if line =~ /flags=\d+<(.+)>/
- flags = $1.split(',')
+ flags = $1.split(",")
iface[cint][:flags] = flags if flags.length > 0
end
if line =~ /metric: (\d+) mtu: (\d+)/
iface[cint][:metric] = $1
iface[cint][:mtu] = $2
@@ -98,10 +98,10 @@
net_counters = Mash.new
# From netstat(1), not sure of the implications:
# Show the state of all network interfaces or a single interface
# which have been auto-configured (interfaces statically configured
- # into a system, but not located at boot time are not shown).
+ # into a system, but not located at boot time are not shown).
so = shell_out("netstat -idn")
so.stdout.lines do |line|
# Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll Drop
# em0 1500 <Link> 00:11:25:2d:90:be 3719557 0 3369969 0 0 0
# $1 $2 $3 $4 $5 $6 $7 $8