python-blivet/0002-Fix-crash-when-scanning-degraded-not-fully-assembled.patch

31 lines
1.1 KiB
Diff

From d5169a83f2428dbe2406881e8928a4418c04a365 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Fri, 2 Feb 2024 12:05:15 +0100
Subject: [PATCH] Fix crash when scanning degraded/not fully assembled MD
arrays
When we don't have the array name we cannot construct device ID
for the devicetree lookup, we need to let the code fallback to
other means like UUID.
---
blivet/populator/helpers/mdraid.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blivet/populator/helpers/mdraid.py b/blivet/populator/helpers/mdraid.py
index 6d66b0c0..22ca5195 100644
--- a/blivet/populator/helpers/mdraid.py
+++ b/blivet/populator/helpers/mdraid.py
@@ -58,7 +58,8 @@ class MDDevicePopulator(DevicePopulator):
return None
# try to get the device again now that we've got all the parents
- device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices)
+ if name:
+ device = self._devicetree.get_device_by_device_id("MDRAID-" + name, incomplete=flags.allow_imperfect_devices)
if device is None:
try:
--
2.43.0