diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-05-26 15:29:25 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2010-05-26 16:22:05 +0200 |
commit | b213dceca01acfedf97afdc917c8cc7a871417c3 (patch) | |
tree | 5da850af9f7f3f39b68a5c70961361f534d67751 /storage | |
parent | c43224edbc6decfc666268a62731e9bef5a170ab (diff) | |
download | anaconda-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.py | 6 |
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 |