]> git.proxmox.com Git - pve-guest-common.git/commitdiff
vzdump: command line: refactor handling prune-backups
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 15 Feb 2021 12:24:57 +0000 (13:24 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Feb 2021 15:29:58 +0000 (16:29 +0100)
to re-use a line here and with the next patch.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/VZDump/Common.pm

index af141dec977805de3f92e77871da5d7def5796f7..eceea7fcf05d2dc74f64d96dca8ebef99f961415 100644 (file)
@@ -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 '';
        }
     }