summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-11-18 16:39:15 -0800
committerGitHub <noreply@github.com>2020-11-18 16:39:15 -0800
commitf58d6f0a1470ca5314ed5a4267165f97394d5aa8 (patch)
tree0c274d11a8250b3c9f42c849c2422b7a20139893
parent877976b219de4a36da2693736f62aad504ca3cc4 (diff)
parent65cf02849a7992431088cc6ff2689542d588aa5e (diff)
downloadohai-f58d6f0a1470ca5314ed5a4267165f97394d5aa8.tar.gz
Merge pull request #1577 from chef/simplify_kernel
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/aix/kernel.rb10
-rw-r--r--spec/unit/plugins/aix/kernel_spec.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/ohai/plugins/aix/kernel.rb b/lib/ohai/plugins/aix/kernel.rb
index a6d1cfee..b41a3b3b 100644
--- a/lib/ohai/plugins/aix/kernel.rb
+++ b/lib/ohai/plugins/aix/kernel.rb
@@ -24,12 +24,12 @@ Ohai.plugin(:Kernel) do
collect_data(:aix) do
kernel Mash.new
- uname_so = shell_out("uname -srvp").stdout.split
+ uname_so = shell_out("uname -rvp").stdout.split
- kernel[:name] = uname_so[0].downcase
- kernel[:release] = uname_so[1]
- kernel[:version] = uname_so[2]
- kernel[:machine] = uname_so[3]
+ kernel[:name] = "aix" # this is here for historical reasons, but it's always aix
+ kernel[:release] = uname_so[0]
+ kernel[:version] = uname_so[1]
+ kernel[:machine] = uname_so[2]
kernel[:bits] = shell_out("getconf KERNEL_BITMODE").stdout.strip
modules = Mash.new
diff --git a/spec/unit/plugins/aix/kernel_spec.rb b/spec/unit/plugins/aix/kernel_spec.rb
index b338e9a6..741d986c 100644
--- a/spec/unit/plugins/aix/kernel_spec.rb
+++ b/spec/unit/plugins/aix/kernel_spec.rb
@@ -22,7 +22,7 @@ describe Ohai::System, "AIX kernel plugin" do
before do
@plugin = get_plugin("aix/kernel")
allow(@plugin).to receive(:collect_os).and_return(:aix)
- allow(@plugin).to receive(:shell_out).with("uname -srvp").and_return(mock_shell_out(0, "AIX 2 7 powerpc", nil))
+ allow(@plugin).to receive(:shell_out).with("uname -rvp").and_return(mock_shell_out(0, "2 7 powerpc", nil))
allow(@plugin).to receive(:shell_out).with("genkex -d").and_return(mock_shell_out(0, " Text address Size Data address Size File\nf1000000c0338000 77000 f1000000c0390000 1ec8c /usr/lib/drivers/cluster\n 6390000 20000 63a0000 ba8 /usr/lib/drivers/if_en", nil))
allow(@plugin).to receive(:shell_out).with("getconf KERNEL_BITMODE").and_return(mock_shell_out(0, "64", nil))
@plugin.run