Allowed generated node names to come from free ones available, and not the highest base digit.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12577 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2012-05-08 21:32:11 +00:00
parent b697c63032
commit d71018a664

View File

@ -482,22 +482,6 @@ sub gennodename {
}
} # End of foreach
} # End of foreach
# Are there nodes in this group already?
# If so, use the existing nodes as a base
my $out = `nodels $group`;
@args = split( /\n/, $out );
foreach (@args) {
$_ =~ s/$hostname_regex/$1/g;
# Take the greatest digit
if ( int($_) > $base_digit ) {
$base_digit = int($_);
}
}
# +1 to base digit to obtain next hostname
$base_digit = $base_digit + 1;
# Generate hostname
$hostname = $base_hostname;