]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/templates/default/ohai.rb.erb
Handle HP arrays in interim recovery mode
[chef.git] / cookbooks / hardware / templates / default / ohai.rb.erb
index 8c7d633ab166705bc274568e552e5cdd3a033703..63f4806d93dd971769c4fb759c73f3235f917421 100644 (file)
@@ -317,6 +317,8 @@ Ohai.plugin(:Hardware) do
     disk = nil
 
     IO.popen(%w(ssacli controller all show config detail)).each do |line|
+      next unless line.valid_encoding?
+
       if line =~ /^Smart (?:Array|HBA) (\S+) /
         controller = {
           :id => devices[:controllers].count,
@@ -377,6 +379,7 @@ Ohai.plugin(:Hardware) do
       elsif array && line =~ /^         Status:\s+(.*\S)\s*$/
         case Regexp.last_match(1)
         when "OK" then array[:status] = "optimal"
+        when "Interim Recovery Mode" then array[:status] = "degraded"
         else array[:status] = "unknown"
         end
       elsif array && line =~ /^         (\S[^:]+):\s+(.*\S)\s*$/