]> git.proxmox.com Git - pve-container.git/commitdiff
setup/fedora: use os_release and support 26
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 22 Aug 2017 13:43:25 +0000 (15:43 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Sep 2017 06:53:47 +0000 (08:53 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Setup/Fedora.pm

index 70aab628227db91d28c2cf6d4f297ec5c0365b63..23851d51c2fd5a2df248275ed3c853a935c38acd 100644 (file)
@@ -8,20 +8,10 @@ use PVE::LXC::Setup::CentOS;
 use base qw(PVE::LXC::Setup::CentOS);
 
 sub new {
-    my ($class, $conf, $rootdir) = @_;
+    my ($class, $conf, $rootdir, $os_release) = @_;
 
-    my $release = PVE::Tools::file_read_firstline("$rootdir/etc/fedora-release");
-    die "unable to read version info\n" if !defined($release);
-
-    my $version;
-
-    if ($release =~ m/release\s+(\d+(?:\.\d+)?)(\.\d+)?/) {
-       if ($1 >= 22 && $1 < 26) {
-           $version = $1;
-       }
-    }
-
-    die "unsupported fedora release '$release'\n" if !$version;
+    my $version = $os_release->{VERSION_ID};
+    die "unsupported fedora release\n" if !($version >= 22 && $version <= 26);
 
     my $self = { conf => $conf, rootdir => $rootdir, version => $version };