From 648d1bcd1d55362ba517713954abd022cc3b70eb Mon Sep 17 00:00:00 2001 From: Zhiyuan He <362583303@qq.com> Date: Mon, 8 Mar 2021 12:11:03 +0800 Subject: [PATCH] Fix wrong nvidia gpu card number (#5353) --- .../computing-devices/nvidia.com_gpu/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml index f5f4dad484..bc2d2771c6 100644 --- a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml +++ b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml @@ -46,14 +46,14 @@ - name: "Check NVIDIA GPU card number is matched or not" set_fact: - unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but only {{ nvidia_gpu_count.stdout_lines[0] }} found\"] }}" + unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but {{ nvidia_gpu_count.stdout|trim }} found\"] }}" changed_when: false check_mode: false environment: {} when: # if nvidia-smi doesn't work, we can skip this step - nvidia_smi.rc == 0 - - "nvidia_gpu_count.stdout_lines[0]|int != computing_device_count" + - 'nvidia_gpu_count.stdout|trim|int != computing_device_count' - nvidia_gpu_count.rc == 0 - name: "Check default docker runtime"