Don't log junk if megacli command is missing

This commit is contained in:
Jamie Cameron
2021-01-22 17:54:09 -08:00
parent 8a6f778410
commit ba160dea83

View File

@@ -141,7 +141,8 @@ Returns a list, each element of which is a unit, controller and list of subdisks
sub list_megaraid_subdisks
{
local ($adap) = @_;
local $out = &backquote_command("megacli -pdlist -a$adap");
return () if (!&has_command("megacli"));
local $out = &backquote_command("megacli -pdlist -a$adap 2>/dev/null");
return () if ($?);
my @rv;
foreach my $l (split(/\r?\n/, $out)) {