]> git.proxmox.com Git - pve-storage.git/commitdiff
allow templates using .xz compression
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Jul 2015 08:06:24 +0000 (10:06 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Jul 2015 08:06:24 +0000 (10:06 +0200)
PVE/Storage.pm
PVE/Storage/Plugin.pm

index dee0d59e05893e3060151a786f77fdedd4b4aa94..0452a2de130169e83939e695d104d157f5a6cf7e 100755 (executable)
@@ -683,9 +683,9 @@ sub template_list {
                    $info = { volid => "$sid:iso/$1", format => 'iso' };
 
                } elsif ($tt eq 'vztmpl') {
-                   next if $fn !~ m!/([^/]+\.tar\.gz)$!;
+                   next if $fn !~ m!/([^/]+\.tar\.([gx]z))$!;
 
-                   $info = { volid => "$sid:vztmpl/$1", format => 'tgz' };
+                   $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))$!;
index 092cf9a1f29e36d60cddc008cbdb1d5f639f50e7..310a6589adcb54227dd51983136b04a30593e62a 100644 (file)
@@ -364,7 +364,7 @@ sub parse_volname {
        return ('images', $name, $vmid, undef, undef, $isBase);
     } elsif ($volname =~ m!^iso/([^/]+\.[Ii][Ss][Oo])$!) {
        return ('iso', $1);
-    } elsif ($volname =~ m!^vztmpl/([^/]+\.tar\.gz)$!) {
+    } elsif ($volname =~ m!^vztmpl/([^/]+\.tar\.[gx]z)$!) {
        return ('vztmpl', $1);
     } elsif ($volname =~ m!^rootdir/(\d+)$!) {
        return ('rootdir', $1, $1);