diff options
Diffstat (limited to 'whatmaps/debiandistro.py')
-rw-r--r-- | whatmaps/debiandistro.py | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py index 4fcce54..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 @@ -63,8 +58,11 @@ class DebianDistro(Distro): service_blacklist = set(['kvm', 'qemu-kvm', 'qemu-system-x86']) # Per distro regex filter - service_blacklist_re = set([ - '^user@[0-9]+.service$', # Restarting systemd user service aborts the session + service_blacklist_re = set([ # Restarting these aborts the users session + "^dbus(.service)?$", + "^user@[0-9]+.service$", + "^systemd-logind.service$", + "^(g|k|light|no|sd|w|x)dm(.service)?$", ]) @classmethod @@ -116,10 +114,10 @@ class DebianDistro(Distro): aptconfig = sys.stdin.readline() if not aptconfig or aptconfig == '\n': break - if aptconfig.startswith('Whatmaps::Enable-Restart=') and \ - aptconfig.strip().split('=', 1)[1].lower() in ["true", "1"]: - logging.debug("Service restarts enabled") - whatmaps_enabled = True + if (aptconfig.startswith('Whatmaps::Enable-Restart=') and + aptconfig.strip().split('=', 1)[1].lower() in ["true", "1"]): + logging.debug("Service restarts enabled") + whatmaps_enabled = True if not whatmaps_enabled: return None @@ -140,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, |