Merge ~kissiel/checkbox-support:raids-are-disks-too into checkbox-support:master

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Maciej Kisielewski
Approved revision: e76ddcaa729e520287744cdb5bb1f5da5f07346d
Merged at revision: 58410871b027f80b3d14dc8abd2d5e0aca198b76
Proposed branch: ~kissiel/checkbox-support:raids-are-disks-too
Merge into: checkbox-support:master
Diff against target: 15 lines (+4/-0)
1 file modified
checkbox_support/parsers/udevadm.py (+4/-0)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+379459@code.launchpad.net

Description of the change

Ensure that RAIDs are properly listed by the device resource job

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Once my head got past the two "container" strings, LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
2index b85ee93..11ae6ec 100644
3--- a/checkbox_support/parsers/udevadm.py
4+++ b/checkbox_support/parsers/udevadm.py
5@@ -829,6 +829,10 @@ class UdevadmDevice(object):
6 elif '/dev/md' in self._environment.get('DEVNAME', ''):
7 if "MD_NAME" in self._environment:
8 return self._environment.get("MD_NAME")
9+ # if there's MD_LEVEL in the env and it's not a container it's an
10+ # actual RAID disk
11+ elif self._environment.get("MD_LEVEL", "container") != "container":
12+ return self._environment.get("MD_DEVNAME")
13 elif self.major == "94":
14 # See http://pad.lv/1559189
15 return "IBM s390 Virtual Disk"

Subscribers

People subscribed via source and target branches