neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

Blame SOURCES/0022-Do-not-crash-if-dm_get_member_raid_sets-fails.patch

0b05ab
From 408da7ad8eaedf9edb8dfa240af35a222fa8b481 Mon Sep 17 00:00:00 2001
0b05ab
From: Vojtech Trefny <vtrefny@redhat.com>
0b05ab
Date: Mon, 11 Mar 2019 13:29:04 +0100
0b05ab
Subject: [PATCH] Do not crash if 'dm.get_member_raid_sets' fails (#1684851)
0b05ab
0b05ab
---
0b05ab
 blivet/populator/helpers/dmraid.py | 7 ++++++-
0b05ab
 1 file changed, 6 insertions(+), 1 deletion(-)
0b05ab
0b05ab
diff --git a/blivet/populator/helpers/dmraid.py b/blivet/populator/helpers/dmraid.py
0b05ab
index c8cc3a8e..ed48bd66 100644
0b05ab
--- a/blivet/populator/helpers/dmraid.py
0b05ab
+++ b/blivet/populator/helpers/dmraid.py
0b05ab
@@ -53,7 +53,12 @@ def run(self):
0b05ab
         minor = udev.device_get_minor(self.data)
0b05ab
 
0b05ab
         # Have we already created the DMRaidArrayDevice?
0b05ab
-        rs_names = blockdev.dm.get_member_raid_sets(name, uuid, major, minor)
0b05ab
+        try:
0b05ab
+            rs_names = blockdev.dm.get_member_raid_sets(name, uuid, major, minor)
0b05ab
+        except blockdev.DMError as e:
0b05ab
+            log.error("Failed to get RAID sets information for '%s': %s", name, str(e))
0b05ab
+            return
0b05ab
+
0b05ab
         if len(rs_names) == 0:
0b05ab
             log.warning("dmraid member %s does not appear to belong to any "
0b05ab
                         "array", self.device.name)