]> git.proxmox.com Git - pve-storage.git/commitdiff
fix vmid filter for backup listing
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 6 Sep 2019 12:12:16 +0000 (14:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 9 Sep 2019 14:38:37 +0000 (16:38 +0200)
$1 and $2 get set to undef from the vmid filter regex, so we have to do
the name/format regex after, else we get errors like:

'use of unitiialized value $1[...]'

and the listing is empty

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Storage/Plugin.pm

index bcd948da3291deeb654d361b10a39a6811e681d7..39622f3be1ed77274c8ea67f45a136184442c39a 100644 (file)
@@ -927,8 +927,8 @@ my $get_subdir_files = sub {
            $info = { volid => "$sid:vztmpl/$1", format => "t$2" };
 
        } elsif ($tt eq 'backup') {
-           next if $fn !~ m!/([^/]+\.(tar|tar\.gz|tar\.lzo|tgz|vma|vma\.gz|vma\.lzo))$!;
            next if defined($vmid) && $fn !~  m/\S+-$vmid-\S+/;
+           next if $fn !~ m!/([^/]+\.(tar|tar\.gz|tar\.lzo|tgz|vma|vma\.gz|vma\.lzo))$!;
 
            $info = { volid => "$sid:backup/$1", format => $2 };