From b13b3e407b3243c71989b4e9efb343e113dc9d85 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 30 Dec 2022 13:07:12 +0100 Subject: debiandistro: Avoid lsb module Use /etc/debian_release directly as we don't have the lsb module in Debian anymore. --- whatmaps/debiandistro.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py index 84ab9c8..aaa981a 100644 --- a/whatmaps/debiandistro.py +++ b/whatmaps/debiandistro.py @@ -20,11 +20,6 @@ try: except ImportError: apt_pkg = None -try: - import lsb_release -except ImportError: - lsb_release = None - import logging import os import subprocess @@ -143,10 +138,8 @@ class DebianDistro(Distro): def _security_update_origins(klass): "Determine security update origins from apt configuration" - if lsb_release is None: - raise PkgError("lsb_release not found, can't determine security updates") - - codename = lsb_release.get_distro_information()['CODENAME'] + with open("/etc/debian_version") as f: + codename = f.read().strip() def _subst(line): mapping = {'distro_codename': codename, -- cgit v1.2.3