From cd1db90d59bf9b7597b7ddfb5a0624c33471e0dd Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 27 Jul 2011 08:29:16 +0000 Subject: [PATCH] fixed 3370848, when there are some unreadable XML data, it will output some error message git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10161 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPinv.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/FSPinv.pm b/perl-xCAT/xCAT/FSPinv.pm index b61a59745..ab50575b1 100644 --- a/perl-xCAT/xCAT/FSPinv.pm +++ b/perl-xCAT/xCAT/FSPinv.pm @@ -262,7 +262,16 @@ sub deconfig { ##################################### # Format fsp-api results ##################################### - my $decfg = XMLin($data); + #my $decfg = XMLin($data); + my $decfg; + eval { + $decfg = XMLin($data); + }; + if( $@ ) { + push @result,[$name, "Error: there are some unreadable XML data from the firmware. Please check with the data provider.", -1]; + return (\@result); + } + my $node = $decfg->{NODE}; if( defined($node) && exists($node->{Location_code}) ) { push @result,[$name,"Deconfigured resources", 0];