修复blivet bug

(cherry picked from commit 981b8ce85efdb9260bf439a212b0cae9bd8141b5)
This commit is contained in:
bitcoffee 2021-06-04 03:01:47 +08:00 committed by openeuler-sync-bot
parent 693ce3d331
commit c883f35462
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,26 @@
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

View File

@ -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 <liuxin264@huawei.com> - 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 <yanan@huawei.com> - 3.2.2-4
- Type:bugfix
- ID:NA