elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
- when "Spun Up" then disk[:spun_down] = false
- when "Spun down" then disk[:spun_down] = true
+ when "Failed" then disk[:status] = "failed"
+ when "Spun Up" then disk[:state] = "spun_up"
+ when "Spun down" then disk[:state] = "spun_down"
end
end
elsif disk && line =~ /^(\S.*\S)\s*:\s+(\S.*)$/
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
+ when "Failed" then disk[:status] = "failed"
when "Spun Up" then disk[:state] = "spun_up"
when "Spun down" then disk[:state] = "spun_down"
end