aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2022-12-30 13:07:12 +0100
committerGuido Günther <agx@sigxcpu.org>2022-12-30 13:08:05 +0100
commitb13b3e407b3243c71989b4e9efb343e113dc9d85 (patch)
tree34e23d96912001a43c41f7989a1857757c923d8f
parentae172c0b2d9b8383704bf9e6ac1be50d8e64d166 (diff)
debiandistro: Avoid lsb module
Use /etc/debian_release directly as we don't have the lsb module in Debian anymore.
-rw-r--r--whatmaps/debiandistro.py11
1 files 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,