]> git.proxmox.com Git - pve-storage.git/commit
prune {validate, mark}: preserve input parameter
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 9 Sep 2021 09:58:01 +0000 (11:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 9 Sep 2021 16:07:13 +0000 (18:07 +0200)
commita000e26ce7d30ba2b938402164a9a15e66dd123e
tree3ffcd58d4389f997f2c57491bc4c69f0e3582d63
parent08ca3955036a5dcd72bfe264921ec205e8914119
prune {validate, mark}: preserve input parameter

While the current way to detect settings like { 'keep-last' => 0 } is
concise, it's also wrong, because but the delete operation is visible
to the caller. This resulted in e.g.
    # $hash is { 'keep-all' => 1 }
    my $s = print_property_string($hash, 'prune-backups');
    # $hash is now {}, $s is 'keep-all=1'
because validation is called in print_property_string. The same issue
is present when calling prune_mark_backup_group.

Because validation complains when keep-all and something else is set,
this shouldn't have caused any real issues, besides vzdump with
keep-all=1 wrongly taking the removal path, but without any settings,
so not removing anything:
    INFO: prune older backups with retention:
    INFO: pruned 0 backup(s)

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage.pm
PVE/Storage/Plugin.pm