summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/ec2.rb
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-02-20 19:04:16 +0530
committerGitHub <noreply@github.com>2023-02-20 19:04:16 +0530
commitc9196d809d4429c7cea90731446039090da33730 (patch)
treeedd4da7759ddfffba7be64cccfbff88ffb4b21a9 /lib/ohai/plugins/ec2.rb
parent540555c0543f20b65f7416a7bc245d582534613a (diff)
downloadohai-c9196d809d4429c7cea90731446039090da33730.tar.gz
Update rubocop-performance requirement from 1.15.2 to 1.16.0 (#1784)
* Update rubocop-performance requirement from 1.15.2 to 1.16.0 Updates the requirements on [rubocop-performance](https://github.com/rubocop/rubocop-performance) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop-performance/releases) - [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.15.2...v1.16.0) --- updated-dependencies: - dependency-name: rubocop-performance dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Fix chefstyle linting errors Signed-off-by: Neha Pansare <neha.pansare@progress.com> * Fix unit test failures due to changing match with include? to fix chefstye error. This happens because method file_val_if_exists returns string only when file is found, else it returns nil Signed-off-by: Neha Pansare <neha.pansare@progress.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Neha Pansare <neha.pansare@progress.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Neha Pansare <neha.pansare@progress.com>
Diffstat (limited to 'lib/ohai/plugins/ec2.rb')
-rw-r--r--lib/ohai/plugins/ec2.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ohai/plugins/ec2.rb b/lib/ohai/plugins/ec2.rb
index e1855434..21e5ac7a 100644
--- a/lib/ohai/plugins/ec2.rb
+++ b/lib/ohai/plugins/ec2.rb
@@ -39,7 +39,7 @@ Ohai.plugin(:EC2) do
# @return [Boolean] do we have Amazon DMI data?
def has_ec2_amazon_dmi?
# detect a version of '4.2.amazon'
- if /Amazon/.match?(file_val_if_exists("/sys/class/dmi/id/bios_vendor"))
+ if file_val_if_exists("/sys/class/dmi/id/bios_vendor").to_s.include?("Amazon")
logger.trace("Plugin EC2: has_ec2_amazon_dmi? == true")
true
else
@@ -54,7 +54,7 @@ Ohai.plugin(:EC2) do
# @return [Boolean] do we have Amazon DMI data?
def has_ec2_xen_dmi?
# detect a version of '4.2.amazon'
- if /amazon/.match?(file_val_if_exists("/sys/class/dmi/id/bios_version"))
+ if file_val_if_exists("/sys/class/dmi/id/bios_version").to_s.include?("amazon")
logger.trace("Plugin EC2: has_ec2_xen_dmi? == true")
true
else