From 1f403a8463d2d9db2b3e305e6c2ed55f9c44a7c1 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 30 Nov 2011 21:09:18 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/ipmi.pm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 958c7b222..c326d05f9 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -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