]> git.proxmox.com Git - pve-manager.git/commitdiff
aplinfo: factoring out regex for vztmpl
authorLorenz Stechauner <l.stechauner@proxmox.com>
Tue, 22 Jun 2021 09:19:16 +0000 (11:19 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 28 Jun 2021 17:16:03 +0000 (19:16 +0200)
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
PVE/APLInfo.pm

index 31522ae57898853326201618c2fad110c3b0646e..fa991a1b6a3f5e6fbf261623306e1b1ff49a09d2 100644 (file)
@@ -8,6 +8,7 @@ use LWP::UserAgent;
 use POSIX qw(strftime);
 
 use PVE::SafeSyslog;
+use PVE::Storage;
 use PVE::Tools qw(run_command);
 use PVE::pvecfg;
 
@@ -83,7 +84,7 @@ sub read_aplinfo_from_fh {
            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}";