fix bug 3164:"rinv <cec> deconfig" can not print out the deconfig resources

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14271 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2012-11-08 02:22:54 +00:00
parent 7469e7dc83
commit 0ac2d31975

View File

@ -287,15 +287,21 @@ sub deconfig {
my $Location_code;
my $RID;
my $TYPE;
if(ref($node->{GARDRECORD}) ne "ARRAY") {
my $dres;
if (ref($node->{GARDRECORD}) eq "ARRAY") {
$dres = $node->{GARDRECORD};
} elsif (ref($node->{GARDRECORD}) eq "HASH") {
push @$dres, $node->{GARDRECORD};
} else {
push @result,[$name,"NO Deconfigured resources", 0];
return( \@result );
}
push @result,[$name,"Deconfigured resources", 0];
push @result,[$name,"Location_code RID Call_Out_Method Call_Out_Hardware_State TYPE", 0];
push @result,[$name,"$node->{Location_code} $node->{RID}", 0];
foreach my $unit(@{$node->{GARDRECORD}}) {
#foreach my $unit(@{$node->{GARDRECORD}}) {
foreach my $unit(@$dres) {
while (my ($key, $unit3) = each(%$unit) ) {
if($key eq "GARDUNIT") {