[PATCH 1/2] Give pre-existing mdraid arrays the proper name in the UI (#596227)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mdadm --examine reports mdraid set names as /dev/md/# rather then /dev/md#
for some sets.
---
 storage/devicetree.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 99adb06..ec1479e 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1614,7 +1614,11 @@ class DeviceTree(object):
             md_name = devicePathToName(md_info.get("device", ""))
             if md_name:
                 try:
-                    minor = int(md_name[2:])     # strip off leading "md"
+                    # md_name can be either md# or md/#
+                    if md_name.startswith("md/"):
+                        minor = int(md_name[3:])     # strip off leading "md/"
+                    else:
+                        minor = int(md_name[2:])     # strip off leading "md"
                 except (IndexError, ValueError):
                     minor = None
                     md_name = None
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux