Fix bug 2894526 lsslp creates same IP with different hostnames

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4532 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhanx 2009-11-10 10:37:13 +00:00
parent 3cd5fb43ae
commit fbf9b8458b

View File

@ -1488,8 +1488,11 @@ sub parse_responses {
# have the same MTMS and may get the same factory name
# If there are same factory name for 2 BPA (should be 2 sides
# on one frame), change them to like <bpa>_1 and <bpa>_2
# Also, remove those nodes that have same IP addresses and
# give a warning message.
##########################################################
my %hostname_record;
my %ip_record;
for my $h ( keys %outhash)
{
my ($name, $ip);
@ -1503,6 +1506,27 @@ sub parse_responses {
next;
}
# my $name_node_pair = {$name=>$h};
# if ( not exists $ip_record{$ip})
# {
# $ip_record{$ip} = [$name_node_pair];
# }
# else
# {
# push @{$ip_record{$ip}}, $name_node_pair;
# }
if ( ! $ip_record{$ip})
{
$ip_record{$ip} = $h;
}
else
{
my $response;
$response->{data}->[0] = "IP address of node $h is conflicting to node $ip_record{$ip}. Remove node $h from discovery result.";
xCAT::MsgUtils->message("W", $response, $request->{callback});
delete $outhash{$h};
}
if (exists $hostname_record{$name})
{
#Name is duplicated