summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/aix/network.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/aix/network.rb')
-rw-r--r--lib/ohai/plugins/aix/network.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ohai/plugins/aix/network.rb b/lib/ohai/plugins/aix/network.rb
index 52e419e3..a0555cce 100644
--- a/lib/ohai/plugins/aix/network.rb
+++ b/lib/ohai/plugins/aix/network.rb
@@ -47,9 +47,7 @@ Ohai.plugin(:Network) do
# minutia such as default gateway/route. lpars return 0 here. wpars return > 0
unless shell_out("uname -W").stdout.to_i > 0
# :default_interface, :default_gateway - route -n get 0
- netstat_so = shell_out("netstat -rn").stdout
- netstat_so.each_line do |line|
- next unless line.start_with?("default")
+ line = shell_out("netstat -rn").stdout.each_line.detect { |l| l.start_with?("default") }
items = line.split(" ")
network[:default_gateway] = items[1]