def create_raid_device_mash(stdout)
device_mash = Mash.new
device_mash[:device_counts] = Mash.new
stdout.lines.each do |line|
case line
when /Version\s+: ([0-9.]+)/
device_mash[:version] = Regexp.last_match[1].to_f
when /Raid Level\s+: raid([0-9]+)/
device_mash[:level] = Regexp.last_match[1].to_i
when /Array Size.*\(([0-9.]+)/
device_mash[:size] = Regexp.last_match[1].to_f
when /State\s+: ([a-z]+)/
device_mash[:state] = Regexp.last_match[1]
when /Total Devices\s+: ([0-9]+)/
device_mash[:device_counts][:total] = Regexp.last_match[1].to_i
when /Raid Devices\s+: ([0-9]+)/
device_mash[:device_counts][:raid] = Regexp.last_match[1].to_i
when /Working Devices\s+: ([0-9]+)/
device_mash[:device_counts][:working] = Regexp.last_match[1].to_i
when /Failed Devices\s+: ([0-9]+)/
device_mash[:device_counts][:failed] = Regexp.last_match[1].to_i
when /Active Devices\s+: ([0-9]+)/
device_mash[:device_counts][:active] = Regexp.last_match[1].to_i
when /Spare Devices\s+: ([0-9]+)/
device_mash[:device_counts][:spare] = Regexp.last_match[1].to_i
end
end
device_mash
end