From 08c435b987e0d5035af9cfa6480e8c04b7466303 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 22 Dec 2015 22:24:37 +0000 Subject: [PATCH] Strip device prefix correctly --- cookbooks/hardware/recipes/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 2f8a4398e..c29185248 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -300,7 +300,7 @@ end disks = node[:hardware][:disk][:disks].map do |disk| if disk[:smart_device] controller = node[:hardware][:disk][:controllers][disk[:controller]] - device = File.basename(controller[:device]) + device = controller[:device].sub("/dev/", "") smart = disk[:smart_device] if device.start_with?("cciss/") && smart =~ /^cciss,(\d+)$/ @@ -312,7 +312,7 @@ disks = node[:hardware][:disk][:disks].map do |disk| munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}" end else - device = File.basename(disk[:device]) + device = disk[:device].sub("/dev/", "") munin = device end -- 2.43.2