-Fix implementation of '-a' on hostnames

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4933 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2010-01-11 19:06:16 +00:00
parent d9be41ccd6
commit 8219fcf64a

View File

@ -56,6 +56,7 @@ sub build_line {
my $domain=shift;
my $othernames=shift;
my @o_names=();
my @n_names=();
if (defined $othernames) {
@o_names=split(/,| /, $othernames);
}
@ -70,9 +71,10 @@ sub build_line {
$_="";
}
} elsif ($ADDNAMES) {
$$othernames = $_.$domain." ".$othernames;
unshift(@n_names,"$_.$domain");
}
}
unshift(@o_names,@n_names);
if ($node =~ m/\.$domain$/i) {
$longname = $node;
@ -83,7 +85,7 @@ sub build_line {
$othernames=join(' ', @o_names);
if ($LONGNAME) { return "$ip $longname $node $othernames\n"; }
elsif ($OTHERNAMESFIRST) { return "$ip $othernames $node $longname\n"; }
elsif ($OTHERNAMESFIRST) { return "$ip $othernames $longname $node\n"; }
else { return "$ip $node $longname $othernames\n"; }
}