From 0a6fe500535469d40c50f5efc8c919e8388e8be4 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 2 May 2025 00:28:45 +0100 Subject: [PATCH] devices: fix node.cpu_cores code for udev rule --- cookbooks/devices/metadata.rb | 1 + cookbooks/devices/templates/default/udev.rules.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbooks/devices/metadata.rb b/cookbooks/devices/metadata.rb index 2f71f6857..a25b0e16f 100644 --- a/cookbooks/devices/metadata.rb +++ b/cookbooks/devices/metadata.rb @@ -6,3 +6,4 @@ description "Configures devices" version "0.1" supports "ubuntu" +depends "chef" diff --git a/cookbooks/devices/templates/default/udev.rules.erb b/cookbooks/devices/templates/default/udev.rules.erb index 25d22514a..ad2451afa 100644 --- a/cookbooks/devices/templates/default/udev.rules.erb +++ b/cookbooks/devices/templates/default/udev.rules.erb @@ -116,6 +116,6 @@ ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="QEMU_HA # Tune md stripe cache and thread count for RAID-5 / RAID-6 arrays <% - group_threads = [(node[:cpu_cores].to_i / 2.0).round, 4].max + group_threads = [(node.cpu_cores.to_i / 2.0).round, 4].max %> ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", ENV{MD_LEVEL}=="raid[56]", ATTR{md/stripe_cache_size}="8192", ATTR{md/group_thread_cnt}="<%= group_threads %>" -- 2.39.5