From 666d42971d9e119f6e6724b0303784276257e7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikolai=20G=C3=BCtschow?= Date: Tue, 19 Mar 2024 16:06:27 +0100 Subject: [PATCH] dist/tools/dhcpv6-pd_ia: recognize Debian correctly --- dist/tools/dhcpv6-pd_ia/pkg/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/tools/dhcpv6-pd_ia/pkg/__init__.py b/dist/tools/dhcpv6-pd_ia/pkg/__init__.py index abbb2311fb..22b15e9787 100644 --- a/dist/tools/dhcpv6-pd_ia/pkg/__init__.py +++ b/dist/tools/dhcpv6-pd_ia/pkg/__init__.py @@ -27,9 +27,7 @@ __email__ = "m.lenders@fu-berlin.de" class PackageManagerFactory(object): @staticmethod def _get_linux_distro(): - if hasattr(platform, "linux_distribution"): - return platform.linux_distribution()[0] - elif os.path.exists("/etc/os-release"): + if os.path.exists("/etc/os-release"): with open("/etc/os-release") as f: for line in f: m = re.match(r"^NAME=\"(.+)\"$", line) @@ -42,7 +40,7 @@ class PackageManagerFactory(object): system = platform.system() if system == "Linux": system = cls._get_linux_distro() - if system in ["Debian", "Ubuntu", "Linux Mint"]: + if system.startswith(("Debian", "Ubuntu", "Linux Mint")): return Apt("Debian") if system in ["Arch Linux"]: return PacMan("Arch")