Look for usernames when adding clusters

Removes and stores the username portion of a server before checking if it's
a cluster or not to allow dynamic username selection in the GUI too.
This commit is contained in:
Kristian Lyngstol 2009-10-18 02:30:08 +02:00 committed by Duncan Ferguson
parent cbb31ca09c
commit d604feee25
3 changed files with 16 additions and 2 deletions

View file

@ -689,10 +689,18 @@ sub resolve_names(@) {
my @servers = @_;
foreach (@servers) {
my $dirty = $_;
my $username = "";
my $node;
logmsg( 3, "Found server $_" );
if ( $clusters{$_} ) {
push( @servers, split( / /, $clusters{$_} ) );
if ( $dirty =~ s/^(.*)@// ) {
$username = $1;
}
if ( $clusters{$dirty} ) {
foreach $node (split( / /, $clusters{$dirty})) {
push( @servers, $username . "@" . $node );
}
$_ = "";
}
}