From: Tom Hughes Date: Tue, 22 Dec 2015 22:24:37 +0000 (+0000) Subject: Strip device prefix correctly X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/08c435b987e0d5035af9cfa6480e8c04b7466303 Strip device prefix correctly --- 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