mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-05 15:08:50 +00:00
vzdump: defaults: convert to prune-backups early enough
Fixes the case where reading from /etc/vzdump.conf fails. Also convert the options read from /etc/vzdump.conf before the loop. That avoids showing a wrong warning when 'prune-backups' is configured in /etc/vzdump.conf, and maxfiles isn't. Previously, because 'maxfiles' from the schema defaults was automatically set, the call to parse_prune_backups_maxfiles after the loop threw the warning that both options are defined. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
ab459f6da0
commit
dd5d80f56a
@ -211,6 +211,7 @@ sub read_vzdump_defaults {
|
|||||||
defined($default) ? ($_ => $default) : ()
|
defined($default) ? ($_ => $default) : ()
|
||||||
} keys %$confdesc
|
} keys %$confdesc
|
||||||
};
|
};
|
||||||
|
$parse_prune_backups_maxfiles->($defaults, "defaults in VZDump schema");
|
||||||
|
|
||||||
my $raw;
|
my $raw;
|
||||||
eval { $raw = PVE::Tools::file_get_contents($fn); };
|
eval { $raw = PVE::Tools::file_get_contents($fn); };
|
||||||
@ -225,6 +226,7 @@ sub read_vzdump_defaults {
|
|||||||
my @mailto = split_list($res->{mailto});
|
my @mailto = split_list($res->{mailto});
|
||||||
$res->{mailto} = [ @mailto ];
|
$res->{mailto} = [ @mailto ];
|
||||||
}
|
}
|
||||||
|
$parse_prune_backups_maxfiles->($res, "options in '$fn'");
|
||||||
|
|
||||||
foreach my $key (keys %$defaults) {
|
foreach my $key (keys %$defaults) {
|
||||||
$res->{$key} = $defaults->{$key} if !defined($res->{$key});
|
$res->{$key} = $defaults->{$key} if !defined($res->{$key});
|
||||||
@ -235,8 +237,6 @@ sub read_vzdump_defaults {
|
|||||||
delete $res->{dumpdir};
|
delete $res->{dumpdir};
|
||||||
}
|
}
|
||||||
|
|
||||||
$parse_prune_backups_maxfiles->($res, "options in '$fn'");
|
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user