[pve-devel] [PATCH v2 guest-common 3/8] vzdump: command line: refactor handling prune-backups

Fabian Ebner f.ebner at proxmox.com
Mon Feb 15 13:24:57 CET 2021


to re-use a line here and with the next patch.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

New in v2.

 PVE/VZDump/Common.pm | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/PVE/VZDump/Common.pm b/PVE/VZDump/Common.pm
index af141de..eceea7f 100644
--- a/PVE/VZDump/Common.pm
+++ b/PVE/VZDump/Common.pm
@@ -393,11 +393,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 {
+	    $v = PVE::JSONSchema::print_property_string($v, 'prune-backups')
+		if $p eq 'prune-backups';
+
 	    $cmd .= " --$p " . PVE::Tools::shellquote($v) if defined($v) && $v ne '';
 	}
     }
-- 
2.20.1






More information about the pve-devel mailing list