Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add scope attribute to IPv4 addresses

  • Loading branch information...
commit ef411f5a04af6dfdbe54251fe87335c5a40ff135 1 parent 12af179
@hollow hollow authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/ohai/plugins/linux/network.rb
View
4 lib/ohai/plugins/linux/network.rb
@@ -97,6 +97,10 @@ def encaps_lookup(encap)
if line =~ /brd (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/
iface[cint][:addresses][tmp_addr][:broadcast] = $1
end
+
+ if line =~ /scope (\w+)/
+ iface[cint][:addresses][tmp_addr][:scope] = ($1.eql?("host") ? "Node" : $1.capitalize)
+ end
end
if line =~ /inet6 ([a-f0-9\:]+)\/(\d+) scope (\w+)/
iface[cint][:addresses] = Mash.new unless iface[cint][:addresses]
Please sign in to comment.
Something went wrong with that request. Please try again.