[pve-devel] [PATCH manager 3/3] jobs: vzdump: fixup prune-schedule conf

Dominik Csapak d.csapak at proxmox.com
Fri Nov 12 13:37:27 CET 2021


when we parse the config, we get the 'prune-backup' decoded, but the
api call we use wants it as a property string, so encode it here again

this fixes having jobs with prune options

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Jobs/VZDump.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/Jobs/VZDump.pm b/PVE/Jobs/VZDump.pm
index 92b81147..c757eea1 100644
--- a/PVE/Jobs/VZDump.pm
+++ b/PVE/Jobs/VZDump.pm
@@ -72,6 +72,12 @@ sub run {
 	delete $conf->{$opt} if !defined($props->{$opt});
     }
 
+    # fixup prune-backups, we get it decoded but want it as string parameter
+    $conf->{'prune-backups'} = PVE::JSONSchema::print_property_string(
+	$conf->{'prune-backups'},
+	'prune-backups',
+    ) if $conf->{'prune-backups'} && ref($conf->{'prune-backups'}) eq 'HASH';
+
     $conf->{quiet} = 1; # do not write to stdout/stderr
 
     PVE::Cluster::cfs_update(); # refresh vmlist
-- 
2.30.2






More information about the pve-devel mailing list