diff options
author | Tim Smith <tsmith@chef.io> | 2018-04-17 16:00:06 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-04-17 16:00:06 -0700 |
commit | 0ec2db560aa14d7a37913cccdfab00a8a0abcea4 (patch) | |
tree | c3084e6933fe39235a596bcff2b99fde4a05e156 | |
parent | e732675de44e047c89695c30cdbd32cbf72ab551 (diff) | |
download | ohai-0ec2db560aa14d7a37913cccdfab00a8a0abcea4.tar.gz |
Handle unknown IDs at lookup time
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/common/dmi.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb index f7298f91..b16eebb3 100644 --- a/lib/ohai/common/dmi.rb +++ b/lib/ohai/common/dmi.rb @@ -81,7 +81,6 @@ module Ohai 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] = "dmi_id_#{id}" unless ID_TO_DESCRIPTION[id] end else Ohai::Log.warn("The DMI plugin additional_dmi_ids config must be array of IDs!") @@ -97,7 +96,7 @@ module Ohai id = DMI::ID_TO_DESCRIPTION[id] else Ohai::Log.debug("unrecognized header id; falling back to 'unknown'") - id = "unknown" + id = "unknown_dmi_id_#{id}" end rescue Ohai::Log.debug("failed to look up id #{id}, returning unchanged") |