From 13d2cb7980e6e445b2439ed69da00599d795d520 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 1 Jul 2015 10:06:24 +0200 Subject: [PATCH] allow templates using .xz compression --- PVE/Storage.pm | 4 ++-- PVE/Storage/Plugin.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index dee0d59..0452a2d 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -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))$!; diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 092cf9a..310a658 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -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); -- 2.39.2