]> git.openstreetmap.org Git - chef.git/commitdiff
Fix detection of NVME disks
authorTom Hughes <tom@compton.nu>
Sun, 22 May 2016 18:23:27 +0000 (19:23 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 22 May 2016 18:28:22 +0000 (19:28 +0100)
cookbooks/hardware/templates/default/ohai.rb.erb

index fec5d6bf319ca9fe39277c55954286cf755ca8ec..e83343a8ed8198611b84513c36d57fdea7437a39 100644 (file)
@@ -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 = {