From 698a1919ded855f4736b5c6db20c98b78ed98d8e Mon Sep 17 00:00:00 2001 From: yinle Date: Tue, 18 Jan 2011 07:51:06 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/dhcp.pm | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 9f9fffd1f..4bbd6cc3a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -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; } }