We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48a37a3 commit 79d7207Copy full SHA for 79d7207
app/models/operating_system.rb
@@ -28,7 +28,7 @@ class OperatingSystem < ApplicationRecord
28
["linux_debian", %w[debian]],
29
["linux_esx", %w[vmnixx86 vmwareesxserver esxserver vmwareesxi]],
30
["linux_solaris", %w[solaris]],
31
- ["linux_oracle", %w[oracle]],
+ ["linux_oracle", ["oracle", /^ol/]],
32
["linux_photon", %w[photon]],
33
["linux_generic", %w[linux]],
34
["unix_aix", %w[aix vios]],
@@ -79,7 +79,10 @@ def self.normalize_os_name(os_name)
79
clean_os_name = os_name.downcase.gsub(/[^a-z0-9]/, "")
80
OS_MAP.each do |normalized_name, candidate_names|
81
candidate_names.each do |candidate|
82
- return normalized_name if clean_os_name.include?(candidate)
+ if (candidate.kind_of?(String) && clean_os_name.include?(candidate)) ||
83
+ (candidate.kind_of?(Regexp) && clean_os_name.match?(candidate))
84
+ return normalized_name
85
+ end
86
end
87
88
"unknown"
0 commit comments