summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
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