From 4ef1f5e707567817dcc3af4a98483381ef7bf318 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 24 Jul 2022 19:58:30 +0100 Subject: [PATCH] Ignore invalid lines in ssacli output --- cookbooks/hardware/templates/default/ohai.rb.erb | 2 ++ 1 file changed, 2 insertions(+) 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, -- 2.39.5