fix two perl syntax errors in nodestat.pm: Use of uninitialized value

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14270 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2012-11-08 02:19:31 +00:00
parent d70c8c2cc5
commit 7469e7dc83

View File

@ -597,7 +597,7 @@ sub process_request_nmap {
foreach (@nodes) {
$unknownnodes{$_}=1;
my $ip = undef;
if ($hostsents{$_}) {
if (($hostsents{$_}) && ($hostsents{$_}->[0]->{ip})) {
$ip = $hostsents{$_}->[0]->{ip};
$nodebyip{$ip} = $_;
$ip = xCAT::NetworkUtils->getipaddr($ip);
@ -699,7 +699,7 @@ sub process_request_nmap {
if (/^PORT/) { next; }
($port,$state) = split;
if ($port and $port =~ /^(\d*)\// and $state eq 'open') {
if ($1 eq "3001" and $chainhash{$currnode}->[0]->{currstate} =~ /^install/) {
if ($1 eq "3001" and defined($chainhash{$currnode}->[0]->{currstate}) and $chainhash{$currnode}->[0]->{currstate} =~ /^install/) {
$installquerypossible=1; #It is possible to actually query node
} elsif ($1 ne "3001") {
$states{$portservices{$1}}=1;