From cad677f29a750ca3f9797fdcd0cf4a4126ef83b5 Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Wed, 18 Jun 2014 13:38:05 +0800 Subject: [PATCH] fix noderegenips generate conflict ips --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 9f25a3b7a..ff6905293 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -761,7 +761,7 @@ Usage: } # make sure there are something changed, otherwise we should quit without any changes. unless ($changeflag){ - setrsp_errormsg("No profile changes detect."); + setrsp_infostr("Warning: no profile changes detect."); return; } @@ -931,11 +931,15 @@ Usage: #6. Generate new free IPs for each network. my @allknownips = keys %allips; + my %netFreeIPsHash = (); foreach my $updnic (@updateNics){ #No need generate for removed nics. unless (grep {$_ eq $updnic} @removedNics){ my $netname = $netProfileNicsRef->{$netProfileName}->{$updnic}->{"network"}; - $freeIPsHash{$updnic} = xCAT::ProfiledNodeUtils->get_allocable_staticips_innet($netname, \@allknownips); + if ( not exists $netFreeIPsHash{$netname} ){ + $netFreeIPsHash{$netname} = xCAT::ProfiledNodeUtils->get_allocable_staticips_innet($netname, \@allknownips); + } + $freeIPsHash{$updnic} = $netFreeIPsHash{$netname}; } }