Blame SOURCES/0009-kpatch-do-not-try-to-read-kpatch-data-if-it-could-no.patch

0cd6dc
From 6b43c42078604b0551923c2801108848e97ba3b9 Mon Sep 17 00:00:00 2001
0cd6dc
From: "Bryn M. Reeves" <bmr@redhat.com>
0cd6dc
Date: Tue, 14 Oct 2014 15:43:20 +0100
0cd6dc
Subject: [PATCH 09/93] [kpatch] do not try to read kpatch data if it could not
0cd6dc
 be run
0cd6dc
0cd6dc
Everything the kpatch plugin does requires the list of available
0cd6dc
kpatch patches obtained from 'kpatch list'. If this fails return
0cd6dc
immediately from the setup method.
0cd6dc
0cd6dc
Fixes #417.
0cd6dc
0cd6dc
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0cd6dc
---
0cd6dc
 sos/plugins/kpatch.py | 2 ++
0cd6dc
 1 file changed, 2 insertions(+)
0cd6dc
0cd6dc
diff --git a/sos/plugins/kpatch.py b/sos/plugins/kpatch.py
0cd6dc
index 7909926..6ef557e 100644
0cd6dc
--- a/sos/plugins/kpatch.py
0cd6dc
+++ b/sos/plugins/kpatch.py
0cd6dc
@@ -27,6 +27,8 @@ class Kpatch(Plugin, RedHatPlugin):
0cd6dc
 
0cd6dc
     def setup(self):
0cd6dc
         kpatch_list = self.get_cmd_output_now("kpatch list")
0cd6dc
+        if not kpatch_list:
0cd6dc
+            return
0cd6dc
         kpatches = open(kpatch_list, "r").read().splitlines()
0cd6dc
         for patch in kpatches:
0cd6dc
             if not re.match("^kpatch-.*\(.*\)", patch):
0cd6dc
-- 
0cd6dc
1.9.3
0cd6dc