]> git.openstreetmap.org Git - chef.git/commitdiff
Ignore invalid lines in ssacli output
authorTom Hughes <tom@compton.nu>
Sun, 24 Jul 2022 18:58:30 +0000 (19:58 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 24 Jul 2022 18:58:30 +0000 (19:58 +0100)
cookbooks/hardware/templates/default/ohai.rb.erb

index 8c7d633ab166705bc274568e552e5cdd3a033703..5d4d86c56fad592583ffcb757f26785dc5c45659 100644 (file)
@@ -317,6 +317,8 @@ Ohai.plugin(:Hardware) do
     disk = nil
 
     IO.popen(%w(ssacli controller all show config detail)).each do |line|
     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,
       if line =~ /^Smart (?:Array|HBA) (\S+) /
         controller = {
           :id => devices[:controllers].count,