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

@ -1,3 +1,8 @@
0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.28
* Look for usernames when adding clusters
- Thanks to Kristian Lyngstol for the patch
2009-09-24 Duncan Ferguson <duncan_ferguson@user.sf.net> - v3.27
* Add in list of clusters to 'Add Host' window

1
THANKS
View file

@ -30,5 +30,6 @@ Bogdan Pintea
Gerfried Fuchs
Stanislas Rouvelin
Sami Kerola
Kristian Lyngstol
$Id$

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 );
}
$_ = "";
}
}