limit cli max hosts in prefix to 512

This commit is contained in:
Oliver Gorwits
2018-06-07 21:57:16 +01:00
parent 596d2454d6
commit 662c24c5b5

View File

@@ -112,6 +112,11 @@ my @hostlist = defined $device ? ($net->hostenum) : (undef);
my @job_specs = ();
my $exitstatus = 0;
if (scalar @hostlist > 512) {
info sprintf '%s: aborted - unwise to attempt %s jobs at once', $action, (scalar @hostlist);
exit 1;
}
foreach my $host (@hostlist) {
my $dev = $host ? get_device($host->addr) : undef;
if ($dev and not (blessed $dev and $dev->in_storage) and $action !~ m/^discover/) {