python-blivet/0001-Fix-name-resolution-fo...

23 lines
912 B
Diff

From 97cdeb7ba3db01bcd510b35a44b21549703fe545 Mon Sep 17 00:00:00 2001
From: David Lehman <dlehman@redhat.com>
Date: Tue, 30 Apr 2019 12:49:39 -0400
Subject: [PATCH] Fix name resolution for md member partitions. (#1798792)
---
blivet/udev.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/udev.py b/blivet/udev.py
index 5063e733..7ebdbcb9 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -202,7 +202,7 @@ 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:
+ elif "MD_DEVNAME" in udev_info and os.path.exists(device_get_sysfs_path(udev_info) + "/md"):
mdname = udev_info["MD_DEVNAME"]
if device_is_partition(udev_info):
# for partitions on named RAID we want to use the raid name, not