summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins
diff options
context:
space:
mode:
authorDouglas Thrift <douglas@douglasthrift.net>2013-07-21 11:54:14 -0700
committerBryan McLellan <btm@opscode.com>2013-09-25 08:14:25 -0700
commit645e839075d5e597e2cc4db4d83ff330b1bcdc18 (patch)
tree2357fd2c300666f1d50ce8cb88e4aba0b7b7e9fc /lib/ohai/plugins
parentfc69fd5f3fdaf2368de3d667eb2fdb6e4936f0f3 (diff)
downloadohai-645e839075d5e597e2cc4db4d83ff330b1bcdc18.tar.gz
[OHAI-492] - IP address detection fails if there is an interface with no
addresses * skip interfaces that have no addresses when sorting IP addresses
Diffstat (limited to 'lib/ohai/plugins')
-rw-r--r--lib/ohai/plugins/network.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb
index 72a13109..3a679103 100644
--- a/lib/ohai/plugins/network.rb
+++ b/lib/ohai/plugins/network.rb
@@ -39,6 +39,7 @@ Ohai.plugin do
ipaddresses = []
# ipaddresses going to hold #{family} ipaddresses and their scope
Mash[network['interfaces']].each do |iface, iface_v|
+ next if iface_v.nil? or not iface_v.has_key? 'addresses'
iface_v['addresses'].each do |addr, addr_v|
next if addr_v.nil? or not addr_v.has_key? "family" or addr_v['family'] != family
ipaddresses << {