[pve-devel] [PATCH guest-common] vzdump: print prune-backups options in command_line correctly
Fabian Ebner
f.ebner at proxmox.com
Tue Nov 24 11:32:01 CET 2020
Am 24.11.20 um 11:14 schrieb Fabian Ebner:
> Otherwise it prints the hash reference instead of the prune options.
>
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
>
> AFAICT the result of the function was only used for printing, so this
> should've been a cosmetic problem only.
It is also used for printing the cron job, and so one can end up with a
wrong command line there. It's not possible to trigger via the GUI at least.
I also get an error upon creating a second job after creating a job with
prune-backups options. I'll take a closer look and send a v2.
>
> PVE/VZDump/Common.pm | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/PVE/VZDump/Common.pm b/PVE/VZDump/Common.pm
> index 63a4689..648c906 100644
> --- a/PVE/VZDump/Common.pm
> +++ b/PVE/VZDump/Common.pm
> @@ -377,6 +377,10 @@ sub command_line {
> foreach my $path (split(/\0/, $v || '')) {
> $cmd .= " --$p " . PVE::Tools::shellquote($path);
> }
> + } elsif ($p eq 'prune-backups') {
> + my $property_string = PVE::JSONSchema::print_property_string($v, 'prune-backups');
> + $cmd .= " --$p " . PVE::Tools::shellquote($property_string)
> + if defined($property_string) && $property_string ne '';
> } else {
> $cmd .= " --$p " . PVE::Tools::shellquote($v) if defined($v) && $v ne '';
> }
>
More information about the pve-devel
mailing list