summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-18 09:07:42 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-18 10:12:18 -0800
commitd5696ca0a50dfa35d9015abd51da5908f57647f8 (patch)
tree8993790bc496b0f8b20b74b93caf2dfb84a90350
parent1a882ccad96fdfc5de234c9c72c35bef1a6baba1 (diff)
downloadohai-lcg/chefstyle2.tar.gz
manual chefstyle fixeslcg/chefstyle2
-rw-r--r--lib/ohai/plugins/linux/cpu.rb2
-rw-r--r--lib/ohai/plugins/solaris2/zpools.rb2
-rw-r--r--platform_simulation_specs/common/ohai_plugin_common.rb4
-rw-r--r--spec/unit/plugins/windows/cpu_spec.rb2
4 files changed, 4 insertions, 6 deletions
diff --git a/lib/ohai/plugins/linux/cpu.rb b/lib/ohai/plugins/linux/cpu.rb
index 9b9e0b72..287e8def 100644
--- a/lib/ohai/plugins/linux/cpu.rb
+++ b/lib/ohai/plugins/linux/cpu.rb
@@ -68,7 +68,7 @@ Ohai.plugin(:CPU) do
cpu_number += 1
cpuinfo[current_cpu] = Mash.new
current_cpu_info = $2.split(",")
- for i in current_cpu_info
+ current_cpu_info.each do |i|
name_value = i.split("=")
name = name_value[0].strip
value = name_value[1].strip
diff --git a/lib/ohai/plugins/solaris2/zpools.rb b/lib/ohai/plugins/solaris2/zpools.rb
index 94f0a3ac..9356c29c 100644
--- a/lib/ohai/plugins/solaris2/zpools.rb
+++ b/lib/ohai/plugins/solaris2/zpools.rb
@@ -39,7 +39,7 @@ Ohai.plugin(:Zpools) do
end
# Grab individual health for devices in the zpools
- for pool in pools.keys
+ pools.keys.each do |pool|
pools[pool][:devices] = Mash.new
# Run "zpool status" as non-root user (adm) so that
# the command won't try to open() each device which can
diff --git a/platform_simulation_specs/common/ohai_plugin_common.rb b/platform_simulation_specs/common/ohai_plugin_common.rb
index 78dbc90f..229272c7 100644
--- a/platform_simulation_specs/common/ohai_plugin_common.rb
+++ b/platform_simulation_specs/common/ohai_plugin_common.rb
@@ -32,7 +32,7 @@ module OhaiPluginCommon
# env = JSON.load(env)
- argv = ARGV.map { |arg| if /\ / =~ arg then "\"" + arg + "\"" else arg end }.join " "
+ argv = ARGV.map { |arg| ( /\ / =~ arg ) ? "\"" + arg + "\"" : arg }.join " "
match = data[platform][arch].select { |v| v[:params] == argv && v[:env] == env }
raise "No canned output for these settings." if match.empty?
@@ -199,7 +199,7 @@ def test_plugin(plugin_names, cmd_list)
return
# clean the path directory, in case a previous test was interrupted
- OhaiPluginCommon.clean_path OhaiPluginCommon.get_path, /^.*\.rb$/
+ OhaiPluginCommon.clean_path OhaiPluginCommon.get_path, /^.*\.rb$/ # rubocop:disable Lint/UnreachableCode
l = lambda do |*args|
platforms = args[0]
diff --git a/spec/unit/plugins/windows/cpu_spec.rb b/spec/unit/plugins/windows/cpu_spec.rb
index e2c6a07e..313104bf 100644
--- a/spec/unit/plugins/windows/cpu_spec.rb
+++ b/spec/unit/plugins/windows/cpu_spec.rb
@@ -66,7 +66,6 @@ describe Ohai::System, "Windows cpu plugin" do
@processors = [{ "description" => "Intel64 Family 6 Model 70 Stepping 1",
"deviceid" => "CPU0",
"family" => 2,
- "l2cachesize" => 0,
"manufacturer" => "GenuineIntel",
"maxclockspeed" => 2793,
"numberofcores" => 1,
@@ -78,7 +77,6 @@ describe Ohai::System, "Windows cpu plugin" do
{ "description" => "Intel64 Family 6 Model 70 Stepping 1",
"deviceid" => "CPU1",
"family" => 2,
- "l2cachesize" => 0,
"manufacturer" => "GenuineIntel",
"maxclockspeed" => 2793,
"numberofcores" => 1,