summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay A <avijayr@protonmail.com>2020-10-01 21:54:13 +0530
committerVijay A <avijayr@protonmail.com>2020-10-12 22:03:21 +0530
commit89c96ab6ada5e9914ddd15820cb7d575cc43cc01 (patch)
tree74d63f6939d962e1037afe8d2f960d53024f911a
parenta85afa2658ceb478f29166c8f552586d42710294 (diff)
downloadohai-89c96ab6ada5e9914ddd15820cb7d575cc43cc01.tar.gz
Renamed 'whitelist' to 'allowlist' and 'blacklist' to 'denylist'
Signed-off-by: Vijay A <avijayr@protonmail.com>
-rw-r--r--lib/ohai/common/dmi.rb10
-rw-r--r--lib/ohai/plugins/dmi.rb2
-rw-r--r--lib/ohai/plugins/solaris2/dmi.rb2
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/ohai/common/dmi.rb b/lib/ohai/common/dmi.rb
index 4620a385..d9aefa74 100644
--- a/lib/ohai/common/dmi.rb
+++ b/lib/ohai/common/dmi.rb
@@ -76,11 +76,11 @@ module Ohai
# away some of the less useful IDs
ID_TO_CAPTURE = [ 0, 1, 2, 3, 4, 6, 11 ].freeze
- # the whitelisted DMI IDs. This is combination of the defaults + any additional
+ # the allowlisted DMI IDs. This is combination of the defaults + any additional
# IDs defined in the :additional_dmi_ids config
#
# @return [Array] the list of DMI IDs to capture
- def whitelisted_ids
+ def allowlisted_ids
if Ohai.config[:additional_dmi_ids]
if [ Integer, Array ].include?(Ohai.config[:additional_dmi_ids].class)
return ID_TO_CAPTURE + Array(Ohai.config[:additional_dmi_ids])
@@ -91,6 +91,10 @@ module Ohai
ID_TO_CAPTURE
end
+ ##
+ # @deprecated Use the `allowlisted_ids` method instead.
+ alias whitelisted_ids allowlisted_ids
+
# the human readable description from a DMI ID
#
# @param id [String, Integer] the ID to lookup
@@ -152,7 +156,7 @@ module Ohai
end
end
- module_function :id_lookup, :convenience_keys, :whitelisted_ids
+ module_function :id_lookup, :convenience_keys, :allowlisted_ids, :whitelisted_ids
end
end
end
diff --git a/lib/ohai/plugins/dmi.rb b/lib/ohai/plugins/dmi.rb
index 2aed6d77..75f026c3 100644
--- a/lib/ohai/plugins/dmi.rb
+++ b/lib/ohai/plugins/dmi.rb
@@ -76,7 +76,7 @@ Ohai.plugin(:DMI) do
dmi[:table_location] = table_location[1]
elsif ( handle = handle_line.match(line) )
- unless Ohai::Common::DMI.whitelisted_ids.include?(handle[2].to_i)
+ unless Ohai::Common::DMI.allowlisted_ids.include?(handle[2].to_i)
dmi_record = nil
next
end
diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb
index 7d98c06d..9e4b6343 100644
--- a/lib/ohai/plugins/solaris2/dmi.rb
+++ b/lib/ohai/plugins/solaris2/dmi.rb
@@ -128,7 +128,7 @@ Ohai.plugin(:DMI) do
id = smb_to_id[header_information[3]]
# Don't overcapture for now (OHAI-260)
- unless Ohai::Common::DMI.whitelisted_ids.include?(id)
+ unless Ohai::Common::DMI.allowlisted_ids.include?(id)
dmi_record = nil
next
end