]> git.proxmox.com Git - pve-container.git/commitdiff
update_lxc_config: remove ostype check
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 22 Aug 2017 13:43:24 +0000 (15:43 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 1 Sep 2017 06:53:47 +0000 (08:53 +0200)
We have altogether three calls to this method, all in API context with already
sanitizied ostype.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC.pm

index e3433fb1efacec1a6fbcd4df69b0361a06abe753..241c5b2f2ce50167165c4f753a985ccaa3ec11e8 100644 (file)
@@ -352,17 +352,14 @@ sub update_lxc_config {
     my $custom_idmap = grep { $_->[0] eq 'lxc.id_map' } @{$conf->{lxc}};
 
     my $ostype = $conf->{ostype} || die "missing 'ostype' - internal error";
-    if ($ostype =~ /^(?:debian | ubuntu | centos | fedora | opensuse | archlinux | alpine | gentoo | unmanaged)$/x) {
-       my $inc ="/usr/share/lxc/config/$ostype.common.conf";
-       $inc ="/usr/share/lxc/config/common.conf" if !-f $inc;
-       $raw .= "lxc.include = $inc\n";
-       if ($unprivileged || $custom_idmap) {
-           $inc = "/usr/share/lxc/config/$ostype.userns.conf";
-           $inc = "/usr/share/lxc/config/userns.conf" if !-f $inc;
-           $raw .= "lxc.include = $inc\n"
-       }
-    } else {
-       die "implement me (ostype $ostype)";
+
+    my $inc ="/usr/share/lxc/config/$ostype.common.conf";
+    $inc ="/usr/share/lxc/config/common.conf" if !-f $inc;
+    $raw .= "lxc.include = $inc\n";
+    if ($unprivileged || $custom_idmap) {
+       $inc = "/usr/share/lxc/config/$ostype.userns.conf";
+       $inc = "/usr/share/lxc/config/userns.conf" if !-f $inc;
+       $raw .= "lxc.include = $inc\n"
     }
 
     # WARNING: DO NOT REMOVE this without making sure that loop device nodes