summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-05-26 15:29:25 +0200
committerHans de Goede <hdegoede@redhat.com>2010-05-26 16:22:05 +0200
commitb213dceca01acfedf97afdc917c8cc7a871417c3 (patch)
tree5da850af9f7f3f39b68a5c70961361f534d67751 /storage
parentc43224edbc6decfc666268a62731e9bef5a170ab (diff)
downloadanaconda-b213dceca01acfedf97afdc917c8cc7a871417c3.tar.gz
anaconda-b213dceca01acfedf97afdc917c8cc7a871417c3.tar.xz
anaconda-b213dceca01acfedf97afdc917c8cc7a871417c3.zip
Give pre-existing mdraid arrays the proper name in the UI (#596227)
mdadm --examine reports mdraid set names as /dev/md/# rather then /dev/md# for some sets.
Diffstat (limited to 'storage')
-rw-r--r--storage/devicetree.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 99adb0655..ec1479e7b 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