]> git.openstreetmap.org Git - chef.git/commitdiff
Extract correct device number for Adaptec disks
authorTom Hughes <tom@compton.nu>
Wed, 6 Jan 2016 13:37:04 +0000 (13:37 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 6 Jan 2016 13:37:21 +0000 (13:37 +0000)
cookbooks/hardware/templates/default/ohai.rb.erb

index b2d56c7d86698e2dc8cbd16eb398b3aa0efcab1a..5916ecc06e4d9dcb60e54e18e65f34c31a150b2a 100644 (file)
@@ -632,7 +632,7 @@ Ohai.plugin(:Hardware) do
           disks << disk
         elsif disk && line =~ /^         Reported Channel,Device\(T:L\)\s*:\s+(\d+),(\d+)\(\d+:0\)\s*$/
           disk[:channel_number] = Regexp.last_match(1)
           disks << disk
         elsif disk && line =~ /^         Reported Channel,Device\(T:L\)\s*:\s+(\d+),(\d+)\(\d+:0\)\s*$/
           disk[:channel_number] = Regexp.last_match(1)
-          disk[:device_number] = Regexp.last_match(1)
+          disk[:device_number] = Regexp.last_match(2)
         elsif disk && line =~ /^         (\S.*\S)\s*:\s+(\S.*\S)\s*$/
           case Regexp.last_match(1)
           when "Reported Location" then disk[:location] = Regexp.last_match(2)
         elsif disk && line =~ /^         (\S.*\S)\s*:\s+(\S.*\S)\s*$/
           case Regexp.last_match(1)
           when "Reported Location" then disk[:location] = Regexp.last_match(2)