FSP/BPA redundancy: change the way of finding node's IP address

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8689 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2011-01-18 07:51:06 +00:00
parent 8fa83d7571
commit 698a1919de

View File

@ -1053,14 +1053,23 @@ sub process_request
{
my $ip_hash;
foreach my $node ( @{$req->{node}} ) {
my $hoststab = xCAT::Table->new('hosts');
my $ent = $hoststab->getNodeAttribs( $node, ['ip'] );
if ( $ent->{ip} ) {
if ( $ip_hash->{ $ent->{ip} } ) {
$callback->({error=>["Duplicated IP addresses in hosts table for following nodes: $node," . $ip_hash->{ $ent->{ip} }],errorcode=>[1]});
return;
#need to change the way of finding IP for nodes
my $ifip = xCAT::Utils->isIpaddr($node);
if ($ifip)
{
$ip_hash->{ $node} = $node;
}
else
{
my $hoststab = xCAT::Table->new('hosts');
my $ent = $hoststab->getNodeAttribs( $node, ['ip'] );
if ( $ent->{ip} ) {
if ( $ip_hash->{ $ent->{ip} } ) {
$callback->({error=>["Duplicated IP addresses in hosts table for following nodes: $node," . $ip_hash->{ $ent->{ip} }],errorcode=>[1]});
return;
}
$ip_hash->{ $ent->{ip} } = $node;
}
$ip_hash->{ $ent->{ip} } = $node;
}
}