]> git.proxmox.com Git - pve-manager.git/commitdiff
restore default value of 0 for remove/maxfiles
authorStefan Reiter <s.reiter@proxmox.com>
Thu, 5 Nov 2020 15:21:51 +0000 (16:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 5 Nov 2020 15:29:00 +0000 (16:29 +0100)
If neither the 'remove' option of vzdump nor the 'maxfiles' option in
the storage config are set, assume a value of 0, i.e. do not delete
anything and allow unlimited backups.

Restores previous behaviour that was broken in e6946086e3.

Also fixes a warning about using '== 0' on a non-number type.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/VZDump.pm

index 6873ceafa847f9dee742daff0d3f94c057c8d6b9..517becb1b3f75422fd56366b31b42a4f3bb8dcfc 100644 (file)
@@ -474,7 +474,7 @@ sub new {
 
            if (!defined($opts->{'prune-backups'}) && !defined($opts->{maxfiles})) {
                $opts->{'prune-backups'} = $info->{'prune-backups'};
-               $opts->{maxfiles} = $info->{maxfiles};
+               $opts->{maxfiles} = $info->{maxfiles} // 0;
                if ($opts->{maxfiles} == 0) {
                    # zero means keep all, so avoid triggering any remove code path to be safe
                    $opts->{remove} = 0;