Blame SOURCES/0001-test-plugin-crash-if-needs-restarting-d-does-not-exist.patch

a17c88
From aa1f12be109a2d997eeb1c1cce22beb09dd21d04 Mon Sep 17 00:00:00 2001
a17c88
From: Nicola Sella <nsella@redhat.com>
a17c88
Date: Thu, 11 Jun 2020 09:32:17 +0200
a17c88
Subject: [PATCH 1/2] [needs-restarting] Fix plugin fail if needs-restarting.d
a17c88
 does not exist
a17c88
a17c88
includes pep8 warning fix and string formatting space missing
a17c88
---
a17c88
 plugins/needs_restarting.py | 6 ++++--
a17c88
 1 file changed, 4 insertions(+), 2 deletions(-)
a17c88
a17c88
diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
a17c88
index 91f7e116..6b7dacb6 100644
a17c88
--- a/plugins/needs_restarting.py
a17c88
+++ b/plugins/needs_restarting.py
a17c88
@@ -46,6 +46,8 @@ def get_options_from_dir(filepath, base):
a17c88
     Return set of package names contained in files under filepath
a17c88
     """
a17c88
 
a17c88
+    if not os.path.exists(filepath):
a17c88
+        return set()
a17c88
     options = set()
a17c88
     for file in os.listdir(filepath):
a17c88
         if os.path.isdir(file) or not file.endswith('.conf'):
a17c88
@@ -58,9 +60,9 @@ def get_options_from_dir(filepath, base):
a17c88
     packages = set()
a17c88
     for pkg in base.sack.query().installed().filter(name={x[0] for x in options}):
a17c88
         packages.add(pkg.name)
a17c88
-    for name, file in {x for x in options if x[0] not in packages }:
a17c88
+    for name, file in {x for x in options if x[0] not in packages}:
a17c88
         logger.warning(
a17c88
-            _('No installed package found for package name "{pkg}"'
a17c88
+            _('No installed package found for package name "{pkg}" '
a17c88
                 'specified in needs-restarting file "{file}".'.format(pkg=name, file=file)))
a17c88
     return packages
a17c88
 
a17c88
a17c88
From 57955d299f751cb9927fe501fa086d9153092532 Mon Sep 17 00:00:00 2001
a17c88
From: Nicola Sella <nsella@redhat.com>
a17c88
Date: Thu, 11 Jun 2020 10:53:54 +0200
a17c88
Subject: [PATCH 2/2] [needs-restarting] add kernel-rt to reboot list
a17c88
a17c88
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1806060
a17c88
---
a17c88
 plugins/needs_restarting.py | 4 ++--
a17c88
 1 file changed, 2 insertions(+), 2 deletions(-)
a17c88
a17c88
diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
a17c88
index 6b7dacb6..69203f4d 100644
a17c88
--- a/plugins/needs_restarting.py
a17c88
+++ b/plugins/needs_restarting.py
a17c88
@@ -37,8 +37,8 @@
a17c88
 
a17c88
 # For which package updates we should recommend a reboot
a17c88
 # Mostly taken from https://access.redhat.com/solutions/27943
a17c88
-NEED_REBOOT = ['kernel', 'glibc', 'linux-firmware', 'systemd', 'dbus',
a17c88
-               'dbus-broker', 'dbus-daemon']
a17c88
+NEED_REBOOT = ['kernel', 'kernel-rt', 'glibc', 'linux-firmware',
a17c88
+               'systemd', 'dbus', 'dbus-broker', 'dbus-daemon']
a17c88
 
a17c88
 def get_options_from_dir(filepath, base):
a17c88
     """