[pve-devel] [PATCH manager 2/2] cleanup keep-all handling

Fabian Ebner f.ebner at proxmox.com
Mon Nov 23 15:54:15 CET 2020


If keep-all is set to 0, adding it doesn't make a difference,
if the key is not in the hash, it won't show up in the 'values'.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/VZDump.pm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 178f37f5..c37fa513 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -737,10 +737,7 @@ sub exec_backup_task {
 	my $prune_options = $opts->{'prune-backups'};
 
 	my $backup_limit = 0;
-	my $keep_all = delete $prune_options->{'keep-all'};
-	if ($keep_all) {
-	    $prune_options = { 'keep-all' => 1 };
-	} else {
+	if (!$prune_options->{'keep-all'}) {
 	    foreach my $keep (values %{$prune_options}) {
 		$backup_limit += $keep;
 	    }
-- 
2.20.1






More information about the pve-devel mailing list