Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove an internal reference to blacklist #1468

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ end
group :debug do
gem "pry"
gem "pry-byebug"
gem "pry-stack_explorer"
gem "pry-stack_explorer", "~> 0.4.0" # pin until we drop ruby < 2.6
gem "rb-readline"
end
15 changes: 8 additions & 7 deletions lib/ohai/plugins/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Author:: Bryan McLellan (<[email protected]>)
# Author:: Claire McQuin (<[email protected]>)
# Author:: James Gartrell (<[email protected]>)
# Copyright:: Copyright (c) 2008-2018 Chef Software, Inc.
# Copyright:: Copyright (c) Chef Software, Inc.
# Copyright:: Copyright (c) 2009 Bryan McLellan
# License:: Apache License, Version 2.0
#
Expand Down Expand Up @@ -137,11 +137,12 @@ def pc_system_type_decode(type)
end
end

# see if a WMI name is blacklisted so we can avoid writing out
# useless data to ohai
# see if a WMI name is in the blocked list so we can avoid writing
# out useless data to ohai
#
# @param [String] name the wmi name to check
# @return [Boolean] is the wmi name blacklisted
def blacklisted_wmi_name?(name)
# @return [Boolean] is the wmi name in the blocked list
def blocked_wmi_name?(name)
[
"creation_class_name", # this is just the wmi name
"cs_creation_class_name", # this is just the wmi name
Expand Down Expand Up @@ -262,7 +263,7 @@ def blacklisted_wmi_name?(name)
host = wmi.first_of("Win32_OperatingSystem")
kernel[:os_info] = Mash.new
host.wmi_ole_object.properties_.each do |p|
next if blacklisted_wmi_name?(p.name.wmi_underscore)
next if blocked_wmi_name?(p.name.wmi_underscore)

kernel[:os_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
end
Expand All @@ -277,7 +278,7 @@ def blacklisted_wmi_name?(name)
kernel[:cs_info] = Mash.new
host = wmi.first_of("Win32_ComputerSystem")
host.wmi_ole_object.properties_.each do |p|
next if blacklisted_wmi_name?(p.name.wmi_underscore)
next if blocked_wmi_name?(p.name.wmi_underscore)

kernel[:cs_info][p.name.wmi_underscore.to_sym] = host[p.name.downcase]
end
Expand Down