From 136014b1b9ea1b337d6dd8b12b47699d4057b90c Mon Sep 17 00:00:00 2001 From: Himani Anil Deshpande <79726937+himani2411@users.noreply.github.com> Date: Thu, 23 May 2024 10:04:07 -0400 Subject: [PATCH] [Bug] Adding different values for `kernel-open` option (#2733) Co-authored-by: Himani Deshpande --- .../resources/nvidia_driver/partial/_nvidia_driver_common.rb | 2 +- .../spec/unit/resources/nvidia_driver_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/partial/_nvidia_driver_common.rb b/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/partial/_nvidia_driver_common.rb index fe6f14940..e758d8fc2 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/partial/_nvidia_driver_common.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/partial/_nvidia_driver_common.rb @@ -113,7 +113,7 @@ def compiler_version end def nvidia_kernel_module - if node['cluster']['nvidia']['kernel_open'] == "false" + if ['false', 'no', false].include?(node['cluster']['nvidia']['kernel_open']) "kernel" else "kernel-open" diff --git a/cookbooks/aws-parallelcluster-platform/spec/unit/resources/nvidia_driver_spec.rb b/cookbooks/aws-parallelcluster-platform/spec/unit/resources/nvidia_driver_spec.rb index 95adfb90d..431518576 100644 --- a/cookbooks/aws-parallelcluster-platform/spec/unit/resources/nvidia_driver_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/spec/unit/resources/nvidia_driver_spec.rb @@ -96,7 +96,7 @@ def self.setup(chef_run, nvidia_driver_version: nil) end describe 'nvidia_driver:nvidia_kernel_module' do - [%w(false kernel), %w(true kernel-open)].each do |kernel_open, kernel_module| + [%w(false kernel), [false, 'kernel'], %w(no kernel), %w(true kernel-open), [true, 'kernel-open'], %w(yes kernel-open)].each do |kernel_open, kernel_module| context "node['cluster']['nvidia']['kernel_open'] is #{kernel_open}" do cached(:chef_run) do ChefSpec::SoloRunner.new(step_into: ['nvidia_driver']) do |node|