diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-11-18 11:53:12 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-11-18 11:53:12 -0800 |
commit | b4c50060f06c1539e8843849c762c40e61624db2 (patch) | |
tree | 5683317e49301b1f3c3a04afcfee3cf1b1ce4eb0 | |
parent | f45a5908d21ae7c376c4b73ceb904d0b46ac723f (diff) | |
download | ohai-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.rb | 2 |
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 |