diff options
author | Tim Smith <tsmith@chef.io> | 2018-02-25 18:16:46 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-02-25 18:16:46 -0800 |
commit | f594e8ae38724c27ee1657a80a111589bb57ea70 (patch) | |
tree | f8c8fcb2902269325e1d86f6a4d8f3d500f1377c | |
parent | 6f2f5a75036b1bb896daa2367bcb7f852145b38d (diff) | |
download | ohai-f594e8ae38724c27ee1657a80a111589bb57ea70.tar.gz |
Simplify blacklisting the OEM bitmap image
We're only blacklisting a single item. Avoid having to do array include checks. This whole thing was overly complex and slower than it needed to be.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/kernel.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/ohai/plugins/kernel.rb b/lib/ohai/plugins/kernel.rb index a5a8ef17..c580da7c 100644 --- a/lib/ohai/plugins/kernel.rb +++ b/lib/ohai/plugins/kernel.rb @@ -185,18 +185,13 @@ Ohai.plugin(:Kernel) do kernel[:version] = "#{kernel[:os_info][:version]} #{kernel[:os_info][:csd_version]} Build #{kernel[:os_info][:build_number]}" kernel[:os] = os_lookup(kernel[:os_info][:os_type]) || languages[:ruby][:host_os] - host = wmi.first_of("Win32_ComputerSystem") kernel[:cs_info] = Mash.new - cs_info_blacklist = [ - "oem_logo_bitmap", - ] + host = wmi.first_of("Win32_ComputerSystem") host.wmi_ole_object.properties_.each do |p| - if !cs_info_blacklist.include?(p.name.wmi_underscore) - kernel[:cs_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase] - end + next if p.name.wmi_underscore == "oem_logo_bitmap" # big bitmap doesn't need to be in ohai + kernel[:cs_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase] end kernel[:machine] = machine_lookup("#{kernel[:cs_info][:system_type]}") - end end |