More gracefully cope with a proprietary FRU field not known to xCAT

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11092 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2011-11-30 21:09:18 +00:00
parent 3093ecc3e5
commit 1f403a8463

View File

@ -2169,8 +2169,20 @@ sub add_fruhash {
my $err;
($err,$fruhash) = parsefru($sessdata->{currfrudata});
if ($err) {
xCAT::SvrUtils::sendmsg([1,":Error reading fru area ".$sessdata->{currfruid}.": $err"],$callback);
return;
my $fru = FRU->new();
if ($sessdata->{currfrutype} and $sessdata->{currfrutype} eq 'dimm') {
$fru->rec_type("dimm,hw");
} else {
$fru->rec_type("hw");
}
$fru->value($err);
$fru->desc($sessdata->{currfrusdr}->id_string);
$sessdata->{fru_hash}->{$sessdata->{frudex}} = $fru;
$sessdata->{frudex} += 1;
undef $sessdata->{currfrudata}; #skip useless calls to add more frus when parsing failed miserably anyway
#xCAT::SvrUtils::sendmsg([1,":Error reading fru area ".$sessdata->{currfruid}.": $err"],$callback);
#return;
}
}
if ($sessdata->{currfruid} == 0) {
@ -2257,7 +2269,7 @@ sub parsefru {
if ($bytes->[0]==0 or $bytes->[0]==0xff) { #not in spec, but probably unitialized, xCAT probably will rewrite fresh
return "clear",undef;
} else { #some meaning suggested, but not parsable, xCAT shouldn't meddle
return "unknown",undef;
return "Unrecognized FRU format",undef;
}
}
if ($bytes->[1]) { #The FRU spec, unfortunately, gave no easy way to tell the size of internal area