From 11d05d8307620001ae5f7f389f85e86a614534aa Mon Sep 17 00:00:00 2001 From: bitcoffee <854182924@qq.com> Date: Fri, 4 Jun 2021 03:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dblivet=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 981b8ce85efdb9260bf439a212b0cae9bd8141b5) --- ...partitions-threw-exception-when-raid.patch | 26 +++++++++++++++++++ python-blivet.spec | 9 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 huawei-fix-allocate-partitions-threw-exception-when-raid.patch diff --git a/huawei-fix-allocate-partitions-threw-exception-when-raid.patch b/huawei-fix-allocate-partitions-threw-exception-when-raid.patch new file mode 100644 index 0000000..8fdb59b --- /dev/null +++ b/huawei-fix-allocate-partitions-threw-exception-when-raid.patch @@ -0,0 +1,26 @@ +From 00cdf3f0ace5f4d5407dbf610f056fef667c1cd2 Mon Sep 17 00:00:00 2001 +From: bitcoffeeiux +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 + diff --git a/python-blivet.spec b/python-blivet.spec index c376422..9efe6d5 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.2.2 -Release: 4 +Release: 5 Epoch: 1 Summary: A python module for system storage configuration License: LGPLv2+ @@ -21,6 +21,7 @@ Patch0: 0001-force-lvm-plugin.patch Patch1: Fix-name-resolution-for-MD-devices-and-partitions-on.patch Patch9000: fix-the-long-hostname.patch Patch6000: backport-Account-for-pmspare-grow-when-adjusting-thinpool-metadata.patch +Patch9001: huawei-fix-allocate-partitions-threw-exception-when-raid.patch %description The python-blivet package is a python module for examining and modifying @@ -121,6 +122,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README %changelog +* Thu Jun 10 2021 liuxin - 3.2.2-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix allocate_partitions threw an exception while adding /boot to RAID disk + * Tue May 25 2021 yanan - 3.2.2-4 - Type:bugfix - ID:NA -- Gitee