Blob Blame History Raw
From aa1f12be109a2d997eeb1c1cce22beb09dd21d04 Mon Sep 17 00:00:00 2001
From: Nicola Sella <nsella@redhat.com>
Date: Thu, 11 Jun 2020 09:32:17 +0200
Subject: [PATCH 1/2] [needs-restarting] Fix plugin fail if needs-restarting.d
 does not exist

includes pep8 warning fix and string formatting space missing
---
 plugins/needs_restarting.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
index 91f7e116..6b7dacb6 100644
--- a/plugins/needs_restarting.py
+++ b/plugins/needs_restarting.py
@@ -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
 

From 57955d299f751cb9927fe501fa086d9153092532 Mon Sep 17 00:00:00 2001
From: Nicola Sella <nsella@redhat.com>
Date: Thu, 11 Jun 2020 10:53:54 +0200
Subject: [PATCH 2/2] [needs-restarting] add kernel-rt to reboot list

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1806060
---
 plugins/needs_restarting.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
index 6b7dacb6..69203f4d 100644
--- a/plugins/needs_restarting.py
+++ b/plugins/needs_restarting.py
@@ -37,8 +37,8 @@
 
 # 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):
     """