Skip to content

Commit

Permalink
Merge pull request #600 from acaiafa/fix_aix_interface_check
Browse files Browse the repository at this point in the history
Only run ifconfig against active interfaces
  • Loading branch information
thommay committed Aug 14, 2015
2 parents f17beb1 + 6dce1a3 commit 5e5481c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ohai/plugins/aix/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def hex_to_dec_netmask(netmask)
end

# List the interfaces in system.
so = shell_out("lsdev -Cc if")
so = shell_out("lsdev -Cc if | grep Available")
so.stdout.lines.each do |line|
if line =~ /(\S+) (\S+)\s+(.+)/
interface = $1
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/plugins/aix/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
allow(@plugin).to receive(:collect_os).and_return(:aix)
@plugin[:network] = Mash.new
allow(@plugin).to receive(:shell_out).with("netstat -rn |grep default").and_return(mock_shell_out(0, @netstat_rn_grep_default, nil))
allow(@plugin).to receive(:shell_out).with("lsdev -Cc if").and_return(mock_shell_out(0, @lsdev_Cc_if, nil))
allow(@plugin).to receive(:shell_out).with("lsdev -Cc if | grep Available").and_return(mock_shell_out(0, @lsdev_Cc_if, nil))
allow(@plugin).to receive(:shell_out).with("ifconfig en0").and_return(mock_shell_out(0, @ifconfig_en0, nil))
allow(@plugin).to receive(:shell_out).with("entstat -d en0 | grep \"Hardware Address\"").and_return(mock_shell_out(0, "Hardware Address: be:42:80:00:b0:05", nil))
allow(@plugin).to receive(:shell_out).with("netstat -nrf inet").and_return(mock_shell_out(0, @netstat_nrf_inet, nil))
Expand Down

0 comments on commit 5e5481c

Please sign in to comment.