fix the defect that it failed to get the IP address of the BPA or FSP nodename defined

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9224 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2011-04-02 07:29:50 +00:00
parent ec81d5ae6b
commit 1ee230494f

View File

@ -2899,18 +2899,33 @@ sub getNodeIPaddress
push (@nonip, $_);
}
}
if (scalar(@nonip)){
my $hstab = xCAT::Table->new('hosts');
if ( $hstab ) {
my $ent = $hstab->getNodesAttribs(\@nonip,['ip']);
if ($ent){
foreach (@nonip) {
my $i = $ent->{$_}->[0]->{ip};
push (@myip, $i);
}
#if (scalar(@nonip)){
# my $hstab = xCAT::Table->new('hosts');
# if ( $hstab ) {
# my $ent = $hstab->getNodesAttribs(\@nonip,['ip']);
# if ($ent){
# foreach (@nonip) {
# my $i = $ent->{$_}->[0]->{ip};
# push (@myip, $i);
# }
# }
# }
#}
foreach my $t (@nonip) {
$nodeip = xCAT::NetworkUtils->getipaddr($t);
if (!$nodeip) {
my $hoststab = xCAT::Table->new( 'hosts');
my $ent = $hoststab->getNodeAttribs( $t, ['ip'] );
if ( $ent->{'ip'} ) {
$nodeip = $ent->{'ip'};
}
}
}
if($nodeip) {
push (@myip, $nodeip);
}
}
$ips = join ",", @myip;
return $ips;
}