From 4d81711580ed328384d60781d95df39df528a6b3 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 22 May 2016 19:23:27 +0100 Subject: [PATCH] Fix detection of NVME disks --- cookbooks/hardware/templates/default/ohai.rb.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index fec5d6bf3..e83343a8e 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -214,7 +214,7 @@ Ohai.plugin(:Hardware) do end def find_nvme_disks(devices) - Dir.glob("/sys/class/misc/nvme*") do |device| + Dir.glob("/sys/class/nvme/nvme*") do |device| controller = { :id => devices[:controllers].count, :pci_slot => File.basename(Pathname.new("#{device}/device").realpath), @@ -232,7 +232,7 @@ Ohai.plugin(:Hardware) do end end - Dir.glob("#{device}/device/block/*").each do |block| + Dir.glob("#{device}/nvme*").each do |block| size = read_sysctl_file("#{block}/size").to_f / 2 disk = { -- 2.39.5