Fix scanning partitions on RAID arrays (#2269133)

This commit is contained in:
Vojtech Trefny 2024-03-12 20:35:19 +01:00
commit a0175e4d95
2 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,43 @@
From 84b5ee50cadc4a6caf2fd3e608886c01472d6555 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Tue, 12 Mar 2024 14:22:22 +0100
Subject: [PATCH] Fix scanning partitions on RAID arrays (#2269133)
We cannot use get_device_by_device_id here because we get name
from udev.
---
blivet/populator/helpers/partition.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/blivet/populator/helpers/partition.py b/blivet/populator/helpers/partition.py
index 2548f0e9..9257407e 100644
--- a/blivet/populator/helpers/partition.py
+++ b/blivet/populator/helpers/partition.py
@@ -46,21 +46,21 @@ class PartitionDevicePopulator(DevicePopulator):
log_method_call(self, name=name)
sysfs_path = udev.device_get_sysfs_path(self.data)
- device = self._devicetree.get_device_by_device_id(name)
+ device = self._devicetree.get_device_by_name(name)
if device:
return device
disk = None
disk_name = udev.device_get_partition_disk(self.data)
if disk_name:
- disk = self._devicetree.get_device_by_device_id(disk_name)
+ disk = self._devicetree.get_device_by_name(disk_name)
if disk is None:
# create a device instance for the disk
disk_info = six.next((i for i in udev.get_devices()
if udev.device_get_name(i) == disk_name), None)
if disk_info is not None:
self._devicetree.handle_device(disk_info)
- disk = self._devicetree.get_device_by_device_id(disk_name)
+ disk = self._devicetree.get_device_by_name(disk_name)
if disk is None:
# if the disk is still not in the tree something has gone wrong
--
2.44.0

View file

@ -5,7 +5,7 @@ Version: 3.9.1
#%%global prerelease .b2 #%%global prerelease .b2
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2 # prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 1%{?prerelease}%{?dist} Release: 2%{?prerelease}%{?dist}
Epoch: 1 Epoch: 1
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
%global realname blivet %global realname blivet
@ -17,6 +17,8 @@ Source1: http://github.com/storaged-project/blivet/archive/%{realname}-%{realver
Patch0: 0001-remove-btrfs-plugin.patch Patch0: 0001-remove-btrfs-plugin.patch
%endif %endif
Patch1: 0002-Fix-scanning-partitions-on-RAID-arrays-2269133.patch
# Versions of required components (done so we make sure the buildrequires # Versions of required components (done so we make sure the buildrequires
# match the requires versions of things). # match the requires versions of things).
%global partedver 1.8.1 %global partedver 1.8.1
@ -114,6 +116,9 @@ make DESTDIR=%{buildroot} install
%{python3_sitelib}/* %{python3_sitelib}/*
%changelog %changelog
* Tue Mar 12 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.1-2
- Fix scanning partitions on RAID arrays (#2269133)
* Tue Feb 27 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.1-1 * Tue Feb 27 2024 Vojtech Trefny <vtrefny@redhat.com> - 3.9.1-1
- Try to assemble MD arrays during populate (#2236356) (vtrefny) - Try to assemble MD arrays during populate (#2236356) (vtrefny)
- Fix UnboundLocalError in MD populator (vtrefny) - Fix UnboundLocalError in MD populator (vtrefny)