]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Revert "tests/: improve distribution detection"
authorSerge Hallyn <serge@hallyn.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
committerGitHub <noreply@github.com>
Thu, 22 May 2025 11:27:11 +0000 (06:27 -0500)
This reverts commit 091c91fb11e04dd710eb81130690c9486d169204.

tests/system/framework/hosts/base.py

index 764c15aff3e74812b07bb1522a19af4f51bfcb69..a5ee5d914e8446e8e2fe84f9e82872145b0e9dd7 100644 (file)
@@ -54,8 +54,7 @@ class BaseLinuxHost(MultihostHost[ShadowMultihostDomain]):
         """
         self.logger.info(f"Detecting distro information on {self.hostname}")
         os_release = self.fs.read("/etc/os-release")
-        valid_lines = [line for line in os_release.splitlines() if line and not line.startswith("#")]
-        self._os_release = dict(csv.reader(valid_lines, delimiter="="))
+        self._os_release = dict(csv.reader([x for x in os_release.splitlines() if x], delimiter="="))
         if "NAME" in self._os_release:
             self._distro_name = self._os_release["NAME"]
         if "VERSION_ID" not in self._os_release: