From ad8875a8a5f11854d75f0576fa015657af753a46 Mon Sep 17 00:00:00 2001 From: Packit Date: Aug 25 2020 07:46:04 +0000 Subject: Apply patch 0001-test-plugin-crash-if-needs-restarting-d-does-not-exist.patch patch_name: 0001-test-plugin-crash-if-needs-restarting-d-does-not-exist.patch location_in_specfile: 1 present_in_specfile: true --- diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py index 91f7e11..69203f4 100644 --- a/plugins/needs_restarting.py +++ b/plugins/needs_restarting.py @@ -37,8 +37,8 @@ import stat # For which package updates we should recommend a reboot # Mostly taken from https://access.redhat.com/solutions/27943 -NEED_REBOOT = ['kernel', 'glibc', 'linux-firmware', 'systemd', 'dbus', - 'dbus-broker', 'dbus-daemon'] +NEED_REBOOT = ['kernel', 'kernel-rt', 'glibc', 'linux-firmware', + 'systemd', 'dbus', 'dbus-broker', 'dbus-daemon'] def get_options_from_dir(filepath, base): """ @@ -46,6 +46,8 @@ def get_options_from_dir(filepath, base): Return set of package names contained in files under filepath """ + if not os.path.exists(filepath): + return set() options = set() for file in os.listdir(filepath): if os.path.isdir(file) or not file.endswith('.conf'): @@ -58,9 +60,9 @@ def get_options_from_dir(filepath, base): packages = set() for pkg in base.sack.query().installed().filter(name={x[0] for x in options}): packages.add(pkg.name) - for name, file in {x for x in options if x[0] not in packages }: + for name, file in {x for x in options if x[0] not in packages}: logger.warning( - _('No installed package found for package name "{pkg}"' + _('No installed package found for package name "{pkg}" ' 'specified in needs-restarting file "{file}".'.format(pkg=name, file=file))) return packages