* [pve-devel] [PATCH guest-common] vzdump: print prune-backups options in command_line correctly
@ 2020-11-24 10:14 Fabian Ebner
2020-11-24 10:32 ` Fabian Ebner
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2020-11-24 10:14 UTC (permalink / raw)
To: pve-devel
Otherwise it prints the hash reference instead of the prune options.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
AFAICT the result of the function was only used for printing, so this
should've been a cosmetic problem only.
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 '';
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH guest-common] vzdump: print prune-backups options in command_line correctly
2020-11-24 10:14 [pve-devel] [PATCH guest-common] vzdump: print prune-backups options in command_line correctly Fabian Ebner
@ 2020-11-24 10:32 ` Fabian Ebner
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Ebner @ 2020-11-24 10:32 UTC (permalink / raw)
To: pve-devel
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@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 '';
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-24 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 10:14 [pve-devel] [PATCH guest-common] vzdump: print prune-backups options in command_line correctly Fabian Ebner
2020-11-24 10:32 ` Fabian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox