aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-10-14 15:43:20 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-10-14 15:47:33 +0100
commit6b43c42078604b0551923c2801108848e97ba3b9 (patch)
tree90719051ade3dea8e114d7eecdd3aee230d67320
parentbed60dbd576089714d8136b946a46e829bf42971 (diff)
downloadsos-6b43c42078604b0551923c2801108848e97ba3b9.tar.gz
[kpatch] do not try to read kpatch data if it could not be run
Everything the kpatch plugin does requires the list of available kpatch patches obtained from 'kpatch list'. If this fails return immediately from the setup method. Fixes #417. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/kpatch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sos/plugins/kpatch.py b/sos/plugins/kpatch.py
index 7909926a..6ef557e8 100644
--- a/sos/plugins/kpatch.py
+++ b/sos/plugins/kpatch.py
@@ -27,6 +27,8 @@ class Kpatch(Plugin, RedHatPlugin):
def setup(self):
kpatch_list = self.get_cmd_output_now("kpatch list")
+ if not kpatch_list:
+ return
kpatches = open(kpatch_list, "r").read().splitlines()
for patch in kpatches:
if not re.match("^kpatch-.*\(.*\)", patch):