From 866e06115deb1ab25339041b8efd3c8f7547ca39 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 22 Aug 2017 15:43:24 +0200 Subject: [PATCH] update_lxc_config: remove ostype check We have altogether three calls to this method, all in API context with already sanitizied ostype. Signed-off-by: Thomas Lamprecht --- src/PVE/LXC.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index e3433fb..241c5b2 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -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 -- 2.39.2