summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/network.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/network.rb')
-rw-r--r--lib/ohai/plugins/network.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/ohai/plugins/network.rb b/lib/ohai/plugins/network.rb
index 1a1175f5..91547d19 100644
--- a/lib/ohai/plugins/network.rb
+++ b/lib/ohai/plugins/network.rb
@@ -77,13 +77,13 @@ Ohai.plugin(:NetworkAddresses) do
v[:iface] == network[int_attr]
end
if gw_if_ips.empty?
- Ohai::Log.warn("[#{family}] no ip address on #{network[int_attr]}")
+ Ohai::Log.warn("Plugin Network: [#{family}] no ip address on #{network[int_attr]}")
elsif network[gw_attr] &&
network["interfaces"][network[int_attr]] &&
network["interfaces"][network[int_attr]]["addresses"]
if [ "0.0.0.0", "::", /^fe80:/ ].any? { |pat| pat === network[gw_attr] }
# link level default route
- Ohai::Log.debug("link level default #{family} route, picking ip from #{network[gw_attr]}")
+ Ohai::Log.debug("Plugin Network: link level default #{family} route, picking ip from #{network[gw_attr]}")
r = gw_if_ips.first
else
# checking network masks
@@ -92,9 +92,9 @@ Ohai.plugin(:NetworkAddresses) do
end.first
if r.nil?
r = gw_if_ips.first
- Ohai::Log.debug("[#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}")
+ Ohai::Log.debug("Plugin Network: [#{family}] no ipaddress/mask on #{network[int_attr]} matching the gateway #{network[gw_attr]}, picking #{r[:ipaddress]}")
else
- Ohai::Log.debug("[#{family}] Using default interface #{network[int_attr]} and default gateway #{network[gw_attr]} to set the default ip to #{r[:ipaddress]}")
+ Ohai::Log.debug("Plugin Network: [#{family}] Using default interface #{network[int_attr]} and default gateway #{network[gw_attr]} to set the default ip to #{r[:ipaddress]}")
end
end
else
@@ -103,7 +103,7 @@ Ohai.plugin(:NetworkAddresses) do
end
else
r = ips.first
- Ohai::Log.debug("[#{family}] no default interface, picking the first ipaddress")
+ Ohai::Log.debug("Plugin Network: [#{family}] no default interface, picking the first ipaddress")
end
return [ nil, nil ] if r.nil? || r.empty?
@@ -149,13 +149,13 @@ Ohai.plugin(:NetworkAddresses) do
# don't overwrite attributes if they've already been set by the "#{os}::network" plugin
if (family == "inet") && ipaddress.nil?
if r["ip"].nil?
- Ohai::Log.warn("unable to detect ipaddress")
+ Ohai::Log.warn("Plugin Network: unable to detect ipaddress")
else
ipaddress r["ip"]
end
elsif (family == "inet6") && ip6address.nil?
if r["ip"].nil?
- Ohai::Log.debug("unable to detect ip6address")
+ Ohai::Log.debug("Plugin Network: unable to detect ip6address")
else
ip6address r["ip"]
end
@@ -165,10 +165,10 @@ Ohai.plugin(:NetworkAddresses) do
# otherwise we set macaddress on a first-found basis (and we started with ipv4)
if macaddress.nil?
if r["mac"]
- Ohai::Log.debug("setting macaddress to '#{r["mac"]}' from interface '#{r["iface"]}' for family '#{family}'")
+ Ohai::Log.debug("Plugin Network: setting macaddress to '#{r["mac"]}' from interface '#{r["iface"]}' for family '#{family}'")
macaddress r["mac"]
else
- Ohai::Log.debug("unable to detect macaddress for family '#{family}'")
+ Ohai::Log.debug("Plugin Network: unable to detect macaddress for family '#{family}'")
end
end
@@ -177,7 +177,7 @@ Ohai.plugin(:NetworkAddresses) do
if results["inet"]["iface"] && results["inet6"]["iface"] &&
(results["inet"]["iface"] != results["inet6"]["iface"])
- Ohai::Log.debug("ipaddress and ip6address are set from different interfaces (#{results["inet"]["iface"]} & #{results["inet6"]["iface"]})")
+ Ohai::Log.debug("Plugin Network: ipaddress and ip6address are set from different interfaces (#{results["inet"]["iface"]} & #{results["inet6"]["iface"]})")
end
end
end