From e26f6c7225898d3682370548ed0b7f9980606121 Mon Sep 17 00:00:00 2001 From: bitcoffee <854182924@qq.com> Date: Fri, 4 Jun 2021 04:31:37 +0800 Subject: [PATCH] repair bug --- ...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..ca322b5 --- /dev/null +++ b/huawei-fix-allocate-partitions-threw-exception-when-raid.patch @@ -0,0 +1,26 @@ +From c9ddcf46a10738017fb442025c25863c25c20142 Mon Sep 17 00:00:00 2001 +From: bitcoffeeiux +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 + diff --git a/python-blivet.spec b/python-blivet.spec index bad231a..6fb082b 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.3.2 -Release: 1 +Release: 2 Epoch: 1 Summary: A python module for system storage configuration License: LGPLv2+ @@ -19,6 +19,7 @@ BuildRequires: python2-devel python2-setuptools Patch0: 0001-force-lvm-plugin.patch Patch1: fix-the-long-hostname.patch +Patch9000: huawei-fix-allocate-partitions-threw-exception-when-raid.patch %description @@ -120,6 +121,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README.md %changelog +* Thu Jun 10 2021 liuxin - 3.3.2-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix allocate_partitions threw an exception while adding /boot to RAID disk + * Wed Feb 03 2021 gaihuiying - 3.3.2-1 - Type:requirement - ID:NA -- Gitee