Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
use POSIX qw(strftime);
use PVE::SafeSyslog;
use POSIX qw(strftime);
use PVE::SafeSyslog;
use PVE::Tools qw(run_command);
use PVE::pvecfg;
use PVE::Tools qw(run_command);
use PVE::pvecfg;
my $template;
if ($res->{location}) {
$template = $res->{location};
my $template;
if ($res->{location}) {
$template = $res->{location};
- $template =~ s|.*/([^/]+.tar.[gx]z)$|$1|;
+ $template =~ s|.*/([^/]+$PVE::Storage::vztmpl_extension_re)$|$1|;
if ($res->{location} !~ m|^([a-zA-Z]+)\://|) {
# relative localtion (no http:// prefix)
$res->{location} = "$source/$res->{location}";
if ($res->{location} !~ m|^([a-zA-Z]+)\://|) {
# relative localtion (no http:// prefix)
$res->{location} = "$source/$res->{location}";