parallel: Give warning if hostgroup is unknown, and run it anyway.

This commit is contained in:
Ole Tange 2014-11-11 05:09:09 +01:00
parent 95958b623a
commit 2aeb79bfe0

View file

@ -3375,6 +3375,7 @@ sub new {
my $string = $sshlogin_string; my $string = $sshlogin_string;
# An SSHLogin is always in the hostgroup of its $string-name # An SSHLogin is always in the hostgroup of its $string-name
$hostgroups{$string} = 1; $hostgroups{$string} = 1;
@Global::hostgroups{keys %hostgroups} = values %hostgroups;
my @unget = (); my @unget = ();
my $no_slash_string = $string; my $no_slash_string = $string;
$no_slash_string =~ s/[^-a-z0-9:]/_/gi; $no_slash_string =~ s/[^-a-z0-9:]/_/gi;
@ -7450,6 +7451,10 @@ sub new {
if($orig =~ s:@(.+)::) { if($orig =~ s:@(.+)::) {
# We found hostgroups on the arg # We found hostgroups on the arg
@hostgroups = split(/\+/, $1); @hostgroups = split(/\+/, $1);
if(not grep { defined $Global::hostgroups{$_} } @hostgroups) {
::warning("No such hostgroup (@hostgroups)\n");
@hostgroups = (keys %Global::hostgroups);
}
} }
} }
return bless { return bless {