summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-04-17 12:40:39 -0700
committerTim Smith <tsmith@chef.io>2018-04-17 12:40:39 -0700
commite732675de44e047c89695c30cdbd32cbf72ab551 (patch)
treec90ffc9a9a5664f2fcadb11a82d6fbf9ad9e2bff
parent858a5328929171afb638d8b3a931e13cc25568ec (diff)
downloadohai-e732675de44e047c89695c30cdbd32cbf72ab551.tar.gz
Switch to just accepting an Array of IDs
This should work since we have the updated list of descriptions. If it doesn't we'll populate the data with a generic description based on the ID. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/common/dmi.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index dc7d30f8..f7298f91 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -78,13 +78,13 @@ module Ohai
# add additional config defined IDs from the config hash
if Ohai.config[:additional_dmi_ids]
- if Ohai.config[:additional_dmi_ids].is_a?(Hash)
- Ohai.config[:additional_dmi_ids].each_pair do |id, desc|
+ if Ohai.config[:additional_dmi_ids].is_a?(Array)
+ Ohai.config[:additional_dmi_ids].each do |id|
ID_TO_CAPTURE << id
- ID_TO_DESCRIPTION[id] = desc
+ ID_TO_DESCRIPTION[id] = "dmi_id_#{id}" unless ID_TO_DESCRIPTION[id]
end
else
- Ohai::Log.debug("The DMI additional_ids config must be a hash of IDs and their description.")
+ Ohai::Log.warn("The DMI plugin additional_dmi_ids config must be array of IDs!")
end
end