python-blivet/huawei-fix-allocate-partitions-threw-exception-when-raid.patch
bitcoffee c883f35462 修复blivet bug
(cherry picked from commit 981b8ce85efdb9260bf439a212b0cae9bd8141b5)
2021-06-10 15:52:42 +08:00

27 lines
870 B
Diff

From 00cdf3f0ace5f4d5407dbf610f056fef667c1cd2 Mon Sep 17 00:00:00 2001
From: bitcoffeeiux <liuxin264@huawei.com>
Date: Fri, 4 Jun 2021 02:23:37 +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 40644f9..8219841 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -758,6 +758,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