X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3849834ea9239b47721218beccc05be55e8b34a6..2c3bb4b02302a37e1c14e045833feb71b5a3130d:/cookbooks/hardware/templates/default/ohai.rb.erb diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 7757dca80..82194acf2 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -440,10 +440,12 @@ Ohai.plugin(:Hardware) do 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.*)$/ @@ -479,8 +481,10 @@ Ohai.plugin(:Hardware) do 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