From e6d77281713f8ccd140b53e8ece5ed2dec0b6a6c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 7 Nov 2022 15:22:08 +0100 Subject: [PATCH] pbs: wrap getting list volumes for pruning for error context Signed-off-by: Thomas Lamprecht --- PVE/Storage/PBSPlugin.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm index 603529f..633c399 100644 --- a/PVE/Storage/PBSPlugin.pm +++ b/PVE/Storage/PBSPlugin.pm @@ -403,7 +403,8 @@ sub prune_backups { $logfunc //= sub { print "$_[1]\n" }; - my $backups = $class->list_volumes($storeid, $scfg, $vmid, ['backup']); + my $backups = eval { $class->list_volumes($storeid, $scfg, $vmid, ['backup']) }; + die "failed to get list of all backups to prune - $@" if $@; $type = 'vm' if defined($type) && $type eq 'qemu'; $type = 'ct' if defined($type) && $type eq 'lxc'; @@ -411,7 +412,6 @@ sub prune_backups { my $backup_groups = {}; foreach my $backup (@{$backups}) { (my $backup_type = $backup->{format}) =~ s/^pbs-//; - next if defined($type) && $backup_type ne $type; my $backup_group = "$backup_type/$backup->{vmid}";