From 05a21387efcdda3bb483aec4e178b8d3abc2b198 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 4 Nov 2008 17:26:33 +0000 Subject: [PATCH] Handle UNKNOWN node return from xcoll git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2464 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/SINV.pm | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/SINV.pm b/perl-xCAT/xCAT/SINV.pm index d56b95eb4..e749eadaa 100644 --- a/perl-xCAT/xCAT/SINV.pm +++ b/perl-xCAT/xCAT/SINV.pm @@ -662,15 +662,17 @@ sub buildreport } $nodename = pop @info; $template = pop @info; - push @{$nodehash{$template}}, $nodename; # add node name - # to template hash + if ($nodename ne "UNKNOWN") + { + push @{$nodehash{$template}}, $nodename; # add node name + } # to template hash } } else { - if ($dshline !~ /^\s*$/) # skip blanks + if ($dshline !~ /^\s*$/) # skip blanks # skip blanks and stop on the next host { @@ -703,7 +705,10 @@ sub buildreport } $nodename = pop @info; $template = pop @info; - push @{$nodehash{$template}}, $nodename; + if ($nodename ne "UNKNOWN") + { + push @{$nodehash{$template}}, $nodename; + } } # @@ -823,6 +828,12 @@ sub compareoutput $nodename = $nodeline; $nodename =~ s/\s*//g; # remove blanks chomp $nodename; + if ($nodename eq "UNKNOWN") + { # skip this node + @info[0] = "NONE"; + @info[1] = "UNKNOWN"; + return @info; + } $gothosts = 1; } else @@ -943,6 +954,7 @@ sub diffoutput my $hostfound = 0; # build a node array without the header + # skip any UNKNOWN entries added by xcoll foreach $nodeline (@Nodearray) # for each node line { if ($nodeline =~ /================/) @@ -954,6 +966,12 @@ sub diffoutput $nodename = $nodeline; $nodename =~ s/\s*//g; # remove blanks chomp $nodename; + if ($nodename eq "UNKNOWN") + { # skip this node + @info[0] = "NONE"; + @info[1] = "UNKNOWN"; + return @info; + } $hostfound = 1; next; @@ -1416,7 +1434,7 @@ sub storeresults } close FILE; my $rsp = {}; - $rsp->{data}->[0] = "Check $newtempfile for errors.\n"; + $rsp->{data}->[0] = "\nCheck $newtempfile for errors.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); }