From 5926d771d3f695c19e2392516bb793e276638fb9 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 17 Nov 2020 21:58:47 -0800 Subject: Avoid setting the addresses mash twice Just do it at the top of things Signed-off-by: Tim Smith --- lib/ohai/plugins/aix/network.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ohai/plugins/aix/network.rb b/lib/ohai/plugins/aix/network.rb index 1e28e414..214bfa30 100644 --- a/lib/ohai/plugins/aix/network.rb +++ b/lib/ohai/plugins/aix/network.rb @@ -61,6 +61,7 @@ Ohai.plugin(:Network) do int_name, int_data = int_lines.split(":", 2) ifaces[int_name] = Mash.new + ifaces[int_name][:addresses] ||= Mash.new ifaces[int_name][:state] = (int_data.include?(" "inet", "prefixlen" => tmp_prefix } ifaces[int_name][:addresses][tmp_addr][:netmask] = netmask @@ -107,7 +107,6 @@ Ohai.plugin(:Network) do # Query macaddress e_so = shell_out("entstat -d #{int_name} | grep \"Hardware Address\"") - ifaces[int_name][:addresses] ||= Mash.new e_so.stdout.each_line do |l| if l =~ /Hardware Address: (\S+)/ ifaces[int_name][:addresses][$1.upcase] = { "family" => "lladdr" } -- cgit v1.2.1