python-blivet/fix-allocate-partitions-threw-exception-when-raid.patch
2021-12-15 17:25:02 +08:00

27 lines
870 B
Diff

From c9ddcf46a10738017fb442025c25863c25c20142 Mon Sep 17 00:00:00 2001
From: bitcoffeeiux <liuxin264@huawei.com>
Date: Fri, 4 Jun 2021 04:27:53 +0800
Subject: [PATCH] function allocate_partitions threw an exception
while adding /boot partitions to a RAID disk
---
blivet/partitioning.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 53f9cc3..0b544be 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -764,6 +764,8 @@ def allocate_partitions(storage, disks, partitions, freespace, boot_disk=None):
growth = 0 # in sectors
# loop through disks
for _disk in req_disks:
+ if _disk.path not in disklabels:
+ continue
disklabel = disklabels[_disk.path]
best = None
current_free = free
--
2.27.0