]> git.proxmox.com Git - pve-manager.git/commitdiff
backup: fix #2913 order jobs numerically by VMID
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 4 Aug 2020 09:46:38 +0000 (11:46 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 11 Aug 2020 11:48:19 +0000 (13:48 +0200)
At this point, the VMIDs are already numerically sorted by the
PVE::VZDump::check_vmids method. Calling another sort on the array,
especially without `{$a <=> $b}`, resulted in reordering the array
alphabetically.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
PVE/VZDump.pm

index 82976aa415f6a4ff3b511f32e46e63a2b96e9a65..66a20c8c6ab59d5457344dd825d0317c5ae98aa6 100644 (file)
@@ -1048,7 +1048,7 @@ sub exec_backup {
     }
 
     my $vmlist = PVE::Cluster::get_vmlist();
-    foreach my $vmid (sort @{$opts->{vmids}}) {
+    foreach my $vmid (@{$opts->{vmids}}) {
        my $guest_type = $vmlist->{ids}->{$vmid}->{type};
        my $plugin = $vzdump_plugins->{$guest_type};
        next if !$rpcenv->check($authuser, "/vms/$vmid", [ 'VM.Backup' ], $opts->{all});