summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-11-18 11:53:12 -0800
committerTim Smith <tsmith84@gmail.com>2020-11-18 11:53:12 -0800
commitb4c50060f06c1539e8843849c762c40e61624db2 (patch)
tree5683317e49301b1f3c3a04afcfee3cf1b1ce4eb0
parentf45a5908d21ae7c376c4b73ceb904d0b46ac723f (diff)
downloadohai-b4c50060f06c1539e8843849c762c40e61624db2.tar.gz
Don't try to create the arp mash once each line
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/aix/network.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ohai/plugins/aix/network.rb b/lib/ohai/plugins/aix/network.rb
index 954c919d..9e1bae21 100644
--- a/lib/ohai/plugins/aix/network.rb
+++ b/lib/ohai/plugins/aix/network.rb
@@ -128,8 +128,8 @@ Ohai.plugin(:Network) do
# List the arp entries in system.
count = 0
+ network[:arp] ||= Mash.new
shell_out("arp -an").stdout.each_line do |line|
- network[:arp] ||= Mash.new
if line =~ /\s*(\S+) \((\S+)\) at ([a-fA-F0-9\:]+) \[(\w+)\] stored in bucket/
network[:arp][count] ||= Mash.new
network[:arp][count][:remote_host] = $1