Signed-off-by: Francois Gouget fgouget@codeweavers.com --- testbot/bin/Janitor.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl index af1123aed..618c31d02 100755 --- a/testbot/bin/Janitor.pl +++ b/testbot/bin/Janitor.pl @@ -201,14 +201,14 @@ map { $DeletedVMs{$_} = 1 } @{$VMs->GetKeys()};
if (%DeletedVMs) { - foreach my $Task (@{CreateTasks($VMs)->GetItems()}) + my $Tasks = CreateTasks($VMs); + $Tasks->AddFilter("VMName", [keys %DeletedVMs]); + foreach my $Task (@{$Tasks->GetItems()}) { - if (exists $DeletedVMs{$Task->VM->Name}) - { - Trace "Keeping the ", $Task->VM->Name, " VM for task ", $Task->GetSlashKey(), "\n"; - delete $DeletedVMs{$Task->VM->Name}; - last if (!%DeletedVMs); - } + next if (!exists $DeletedVMs{$Task->VMName}); + Trace "Keeping the ", $Task->VMName, " VM for task ", $Task->GetSlashKey(), "\n"; + delete $DeletedVMs{$Task->VMName}; + last if (!%DeletedVMs); } foreach my $VMKey (keys %DeletedVMs) {