!24 update python-blivet to 3.3.2

From: @eaglegai
Reviewed-by: @t_feng
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2021-02-03 16:50:53 +08:00 committed by Gitee
commit 8c7b472cf0
4 changed files with 10 additions and 53 deletions

View File

@ -1,48 +0,0 @@
From 4bf7ef1f6b63d025dd047fe5f1c6dea4ef6c3b40 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Wed, 12 Aug 2020 10:57:19 +0200
Subject: [PATCH] Fix name resolution for MD devices and partitions on them
UDev data for both member disks/partitions and partitions on arrays
contain the MD_* properties we must be extra careful when deciding
what name we'll use for the device.
Resolves: rhbz#1862904
---
blivet/udev.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/blivet/udev.py b/blivet/udev.py
index 66af9a98..32d6369a 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -203,9 +203,16 @@ def device_get_name(udev_info):
""" Return the best name for a device based on the udev db data. """
if "DM_NAME" in udev_info:
name = udev_info["DM_NAME"]
- elif "MD_DEVNAME" in udev_info and os.path.exists(device_get_sysfs_path(udev_info) + "/md"):
+ elif "MD_DEVNAME" in udev_info:
mdname = udev_info["MD_DEVNAME"]
- if device_is_partition(udev_info):
+ if device_is_md(udev_info):
+ # MD RAID array -> use MD_DEVNAME
+ name = mdname
+ elif device_get_format(udev_info) == "linux_raid_member":
+ # MD RAID member -> use SYS_NAME
+ name = udev_info["SYS_NAME"]
+ elif device_is_partition(udev_info):
+ # partition on RAID -> construct name from MD_DEVNAME + partition number
# for partitions on named RAID we want to use the raid name, not
# the node, e.g. "raid1" instead of "md127p1"
partnum = udev_info["ID_PART_ENTRY_NUMBER"]
@@ -214,6 +221,7 @@ def device_get_name(udev_info):
else:
name = mdname + partnum
else:
+ # something else -> default to MD_DEVNAME
name = mdname
else:
name = udev_info["SYS_NAME"]
--
2.20.1.windows.1

Binary file not shown.

BIN
blivet-3.3.2.tar.gz Normal file

Binary file not shown.

View File

@ -2,8 +2,8 @@
%bcond_without python3 %bcond_without python3
Name: python-blivet Name: python-blivet
Version: 3.2.2 Version: 3.3.2
Release: 4 Release: 1
Epoch: 1 Epoch: 1
Summary: A python module for system storage configuration Summary: A python module for system storage configuration
License: LGPLv2+ License: LGPLv2+
@ -18,8 +18,7 @@ BuildRequires: python2-devel python2-setuptools
%endif %endif
Patch0: 0001-force-lvm-plugin.patch Patch0: 0001-force-lvm-plugin.patch
Patch1: Fix-name-resolution-for-MD-devices-and-partitions-on.patch Patch1: fix-the-long-hostname.patch
Patch9000: fix-the-long-hostname.patch
%description %description
@ -118,9 +117,15 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install
%files help %files help
%defattr(-,root,root) %defattr(-,root,root)
%doc README %doc README.md
%changelog %changelog
* Wed Feb 03 2021 gaihuiying <gaihuiying1@huawei.com> - 3.3.2-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update python-blivet to 3.3.2
* Wed Nov 18 2020 gaihuiying <gaihuiying1@huawei.com> - 3.2.2-4 * Wed Nov 18 2020 gaihuiying <gaihuiying1@huawei.com> - 3.2.2-4
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA