delete expired VM from stopped notify

This commit is contained in:
mischa 2023-03-13 11:44:46 +01:00
parent 49fb992d75
commit d82c089e72
1 changed files with 1 additions and 0 deletions

View File

@ -200,6 +200,7 @@ if ($function =~ /notify/) {
my @stopped_vms = qx(vmctl show | grep stopped | awk '{print \$9}');
for my $vm_name (sort keys %vms) {
if (!grep(/$vm_name/, @stopped_vms)) { delete $vms{$vm_name}; next; }
if ($vms{$vm_name}{'donated'} =~ /expire/) { delete $vms{$vm_name}; next; }
}
mailout(\%conf, \%vms);
} else {