summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-05-20 10:07:43 +0100
committerThom May <thom@may.lt>2015-05-20 10:07:43 +0100
commitb7403d562b1b829e9802375cc0e62298bdd7e268 (patch)
treed0427f70739ddd8125046f8805d646a5d951440a
parent75635d898b2898f9b69efec1f6d56bde19757838 (diff)
downloadohai-tm/ignore_unwanted_dmi.tar.gz
Correctly ignore unwanted DMI datatm/ignore_unwanted_dmi
Closes #538 and closes #500
-rw-r--r--lib/ohai/plugins/dmi.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ohai/plugins/dmi.rb b/lib/ohai/plugins/dmi.rb
index 24779ef2..e2349339 100644
--- a/lib/ohai/plugins/dmi.rb
+++ b/lib/ohai/plugins/dmi.rb
@@ -75,7 +75,10 @@ Ohai.plugin(:DMI) do
elsif handle = handle_line.match(line)
# Don't overcapture for now (OHAI-260)
- next unless Ohai::Common::DMI::IdToCapture.include?(handle[2].to_i)
+ unless Ohai::Common::DMI::IdToCapture.include?(handle[2].to_i)
+ dmi_record = nil
+ next
+ end
dmi_record = {:type => Ohai::Common::DMI.id_lookup(handle[2])}