cleanup keep-all handling

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@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-11-23 15:54:15 +01:00 committed by Thomas Lamprecht
parent 7806065d78
commit a76885903c

View File

@ -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;
}