5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-23 17:34:34 +03:00

Fix: path_to_volume_id returned wrong content

type for backup files. Patch includes changes of the test as well.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
This commit is contained in:
Alwin Antreich 2020-04-28 15:58:20 +02:00 committed by Fabian Grünbichler
parent e4dbfde31f
commit 892dc99249
2 changed files with 5 additions and 5 deletions

View File

@ -536,7 +536,7 @@ sub path_to_volume_id {
return ('rootdir', "$sid:rootdir/$vmid");
} elsif ($path =~ m!^$backupdir/([^/]+\.(tar|tar\.gz|tar\.lzo|tgz|vma|vma\.gz|vma\.lzo))$!) {
my $name = $1;
return ('iso', "$sid:backup/$name");
return ('backup', "$sid:backup/$name");
}
}

View File

@ -72,7 +72,7 @@ my @tests = (
description => 'Backup, vma.gz',
volname => "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_11_40.vma.gz",
expected => [
'iso',
'backup',
'local:backup/vzdump-qemu-16110-2020_03_30-21_11_40.vma.gz',
],
},
@ -80,7 +80,7 @@ my @tests = (
description => 'Backup, vma.lzo',
volname => "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_12_45.vma.lzo",
expected => [
'iso',
'backup',
'local:backup/vzdump-qemu-16110-2020_03_30-21_12_45.vma.lzo',
],
},
@ -88,7 +88,7 @@ my @tests = (
description => 'Backup, vma',
volname => "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_13_55.vma",
expected => [
'iso',
'backup',
'local:backup/vzdump-qemu-16110-2020_03_30-21_13_55.vma',
],
},
@ -96,7 +96,7 @@ my @tests = (
description => 'Backup, tar.lzo',
volname => "$storage_dir/dump/vzdump-lxc-16112-2020_03_30-21_39_30.tar.lzo",
expected => [
'iso',
'backup',
'local:backup/vzdump-lxc-16112-2020_03_30-21_39_30.tar.lzo',
],
},