Skip to content

Commit 449827e

Browse files
nyetschehanwen-pcluste
authored andcommitted
RHEL8: switch to gem::version check, not float
The code works for 8.9, but once you reach 8.10, the `.to_f()` calls turns 8.10 into a float, which compared to 8.4 is indeed "less than".
1 parent d6c96e0 commit 449827e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cookbooks/aws-parallelcluster-environment/resources/efa/efa_redhat8.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
action_class do
2424
def efa_supported?
25-
if node['platform_version'].to_f < 8.4
25+
require 'rubygems'
26+
minver = Gem::Version.new("8.4")
27+
ourver = Gem::Version.new(node['platform_version'])
28+
29+
if ourver < minver
2630
log "EFA is not supported in this RHEL version #{node['platform_version']}, supported versions are >= 8.4" do
2731
level :warn
2832
end

0 commit comments

Comments
 (0)