arrays << array
elsif line =~ /^ Device #(\d+)$/
+ disk = nil
+ elsif line =~ /^ Device is a Hard drive$/
disk = {
:id => devices[:disks].count,
:controller => controller[:id],
- :arrays => [],
- :number => Regexp.last_match(1).to_i
+ :arrays => []
}
devices[:disks] << disk
when "Serial" then disk[:serial_number] = Regexp.last_match(2)
when "World-wide name" then disk[:wwn] = Regexp.last_match(2)
when "Total Size" then disk[:size] = memory_to_disk_size(Regexp.last_match(2))
+ when "Size" then disk[:size] = memory_to_disk_size(Regexp.last_match(2))
end
- elsif array && line =~ / Present \(Controller:\d+,Connector:(\d+),Device:(\d+)\) /
- array[:disks] << "Connector #{Regexp.last_match(1)}, Device #{Regexp.last_match(2)}"
+ elsif array && line =~ / Present \(Controller:\d+,((?:Connector|Enclosure):\d+,(?:Device|Slot):\d+)\) /
+ array[:disks] << Regexp.last_match(1).gsub(":", " ").gsub(",", ", ")
elsif array && line =~ /^ (\S.*\S)\s*:\s+(\S.*\S)\s*$/
case Regexp.last_match(1)
when "RAID level" then array[:raid_level] = Regexp.last_match(2)