enh: clush: keep hosts order and no longer dedupe them

The hosts order might have some importance for the caller, so don't
attempt to sort them. Also don't try to dedupe them, it might be
for some reason that the same host appears twice in the list,
so don't make any assumptions on how we are used and just apply
the command on the given hosts, exactly in the order given.
clush
Stéphane Lesimple 1 year ago
parent 9daf0007e1
commit 7951d7b087
No known key found for this signature in database
GPG Key ID: 4B4A3289E9D35658

@ -59,14 +59,13 @@ if (not $command) {
#
# and test external command call
#
my %hosts;
my @hosts;
foreach my $host (split /,/, $list) {
if ($host !~ /^[a-zA-Z0-9.-]+$/) {
if ($host !~ /^[a-zA-Z0-9._:-]+$/) {
osh_exit 'ERR_INVALID_PARAMETER', "This doesn't appear to be a valid host '$host'";
}
$hosts{$host} = 1;
push @hosts, $host;
}
my @hosts = keys %hosts;
if (not @hosts) {
help();

Loading…
Cancel
Save