From: Tom Hughes Date: Sun, 24 Jul 2022 18:58:30 +0000 (+0100) Subject: Ignore invalid lines in ssacli output X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/4ef1f5e707567817dcc3af4a98483381ef7bf318 Ignore invalid lines in ssacli output --- diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 8c7d633ab..5d4d86c56 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -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,