diff options
Diffstat (limited to 'lib/ohai/plugins/gce.rb')
-rw-r--r-- | lib/ohai/plugins/gce.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/gce.rb b/lib/ohai/plugins/gce.rb index 0b2a0155..f8c30b32 100644 --- a/lib/ohai/plugins/gce.rb +++ b/lib/ohai/plugins/gce.rb @@ -27,7 +27,7 @@ Ohai.plugin(:GCE) do # this works even if the system lacks dmidecode use by the Dmi plugin # @return [Boolean] do we have Google Compute Engine DMI data? def has_gce_dmi? - if file_val_if_exists("/sys/class/dmi/id/product_name") =~ /Google Compute Engine/ + if /Google Compute Engine/.match?(file_val_if_exists("/sys/class/dmi/id/product_name")) logger.trace("Plugin GCE: has_gce_dmi? == true") true else @@ -48,7 +48,7 @@ Ohai.plugin(:GCE) do # looks at the Manufacturer and Model WMI values to see if they starts with Google. # @return [Boolean] Are the manufacturer and model Google? def has_gce_system_info? - if RUBY_PLATFORM =~ /mswin|mingw32|windows/ + if RUBY_PLATFORM.match?(/mswin|mingw32|windows/) require "wmi-lite/wmi" wmi = WmiLite::Wmi.new computer_system = wmi.first_of("Win32_ComputerSystem") |