Fix: add missing snippets subdir
since it is a valid content type and adapt the path_to_volume_id_test. Also adds an extra check if all vtype_subdirs are returned. Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
892dc99249
commit
73fcb7bfd1
@ -512,6 +512,7 @@ sub path_to_volume_id {
|
||||
my $tmpldir = $plugin->get_subdir($scfg, 'vztmpl');
|
||||
my $backupdir = $plugin->get_subdir($scfg, 'backup');
|
||||
my $privatedir = $plugin->get_subdir($scfg, 'rootdir');
|
||||
my $snippetsdir = $plugin->get_subdir($scfg, 'snippets');
|
||||
|
||||
if ($path =~ m!^$imagedir/(\d+)/([^/\s]+)$!) {
|
||||
my $vmid = $1;
|
||||
@ -537,6 +538,9 @@ sub path_to_volume_id {
|
||||
} elsif ($path =~ m!^$backupdir/([^/]+\.(tar|tar\.gz|tar\.lzo|tgz|vma|vma\.gz|vma\.lzo))$!) {
|
||||
my $name = $1;
|
||||
return ('backup', "$sid:backup/$name");
|
||||
} elsif ($path =~ m!^$snippetsdir/([^/]+)$!) {
|
||||
my $name = $1;
|
||||
return ('snippets', "$sid:snippets/$name");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user