git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3515 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-06-04 19:11:04 +00:00
parent 05c9e4b58f
commit 23b516e289

View File

@ -32,14 +32,18 @@ sub addnode {
my $foundone=0;
while ($idx <= $#hosts) {
if ($hosts[$idx] =~ /^${ip}\s/ or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}\s/) {
if ($hosts[$idx] =~ /^${ip}\s/ or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.r/) {
#TODO: if foundone, delete a dupe
$hosts[$idx]=build_line($ip, $node, $domain, $othernames);
if ($foundone) {
$hosts[$idx]="";
} else {
$hosts[$idx]=build_line($ip, $node, $domain, $othernames);
}
$foundone=1;
return;
}
$idx++;
}
if ($foundone) { return;}
my $line=build_line($ip, $node, $domain, $othernames);
push @hosts, $line;