diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-13 16:17:38 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-13 16:17:38 -0800 |
commit | e93ecd56d52025657bd1628ddbe82b6feda7e0f5 (patch) | |
tree | 61606a95c43a91fcfa90d4a1a30e11af6e87c26c | |
parent | da8182c0c3aab15cf060bee53f6bd41cb38f1139 (diff) | |
parent | 22a0c5e8559d0849455021f7e92745f233166929 (diff) | |
download | ohai-e93ecd56d52025657bd1628ddbe82b6feda7e0f5.tar.gz |
Merge pull request #704 from chef/tm/fix_lint
Fix some lint cops:
-rw-r--r-- | lib/ohai/plugins/darwin/memory.rb | 9 | ||||
-rw-r--r-- | spec/unit/plugins/aix/memory_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/ruby_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/solaris2/cpu_spec.rb | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/ohai/plugins/darwin/memory.rb b/lib/ohai/plugins/darwin/memory.rb index c1c146bd..64494666 100644 --- a/lib/ohai/plugins/darwin/memory.rb +++ b/lib/ohai/plugins/darwin/memory.rb @@ -31,10 +31,11 @@ Ohai.plugin(:Memory) do vm_stat = shell_out("vm_stat").stdout vm_stat_match = /page size of (\d+) bytes/.match(vm_stat) page_size = if vm_stat_match and vm_stat_match[1] - vm_stat_match[1].to_i - else - 4096 - end + vm_stat_match[1].to_i + else + 4096 + end + vm_stat.split("\n").each do |line| ['wired down', 'active', 'inactive'].each do |match| unless line.index("Pages #{match}:").nil? diff --git a/spec/unit/plugins/aix/memory_spec.rb b/spec/unit/plugins/aix/memory_spec.rb index 439df3a4..80f893d3 100644 --- a/spec/unit/plugins/aix/memory_spec.rb +++ b/spec/unit/plugins/aix/memory_spec.rb @@ -25,7 +25,7 @@ describe Ohai::System, "AIX memory plugin" do allow(@plugin).to receive(:shell_out).with("svmon -G -O unit=MB,summary=longreal | grep '[0-9]'").and_return(mock_shell_out(0, " 513280.00 340034.17 173245.83 62535.17 230400.05 276950.14 70176.00\n", nil)) @swap_s = "allocated = 23887872 blocks used = 288912 blocks free = 23598960 blocks\n" allow(@plugin).to receive(:shell_out).with("swap -s").and_return(mock_shell_out(0,@swap_s, nil)) - end + end it "should get total memory" do @plugin.run diff --git a/spec/unit/plugins/ruby_spec.rb b/spec/unit/plugins/ruby_spec.rb index 7162d7af..2319432a 100644 --- a/spec/unit/plugins/ruby_spec.rb +++ b/spec/unit/plugins/ruby_spec.rb @@ -49,7 +49,7 @@ describe Ohai::System, "plugin ruby" do :host_vendor => ::RbConfig::CONFIG['host_vendor'], :gems_dir => %x{#{ruby_bin} #{::RbConfig::CONFIG['bindir']}/gem env gemdir}.chomp, :gem_bin => [ ::Gem.default_exec_format % 'gem', 'gem' ].map{|bin| "#{::RbConfig::CONFIG['bindir']}/#{bin}" - }.find{|bin| ::File.exists? bin}, + }.find{|bin| ::File.exists? bin}, :ruby_bin => ruby_bin }.each do |attribute, value| it "should have #{attribute} set to #{value.inspect}" do diff --git a/spec/unit/plugins/solaris2/cpu_spec.rb b/spec/unit/plugins/solaris2/cpu_spec.rb index 4983da15..e4b1d891 100644 --- a/spec/unit/plugins/solaris2/cpu_spec.rb +++ b/spec/unit/plugins/solaris2/cpu_spec.rb @@ -2888,7 +2888,7 @@ END expect(@plugin["cpu"]["104"]["core_id"]).to eql("1117") expect(@plugin["cpu"]["112"]["core_id"]).to eql("1124") expect(@plugin["cpu"]["120"]["core_id"]).to eql("1131") - end + end it "should include processor architecture" do expect(@plugin["cpu"]["0"]["arch"]).to eql("sparcv9") |