Merge lp:~cr3/checkbox/942548 into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1286
Proposed branch: lp:~cr3/checkbox/942548
Merge into: lp:checkbox
Diff against target: 24 lines (+5/-3)
1 file modified
checkbox/parsers/udevadm.py (+5/-3)
To merge this branch: bzr merge lp:~cr3/checkbox/942548
Reviewer Review Type Date Requested Status
Brendan Donegan (community) Approve
Review via email: mp+95061@code.launchpad.net

Description of the change

This change has been tested to work with:

A system on the ata bus, the output is the same as before.

A system with a RAID controller on the cciss bus:

> path: /devices/pci0000:40/0000:40:10.0/0000:46:00.0/cciss0/c0d0
> bus: cciss
> category: DISK
> product: LOGICAL VOLUME
> vendor: HP

And a system with a SCSI device on the scsi bus:

> path: /devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:08.0/host4/target4:1:0/4:1:0:0
> bus: scsi
> category: DISK
> driver: sd
> product: VIRTUAL DISK
> vendor: Dell

To post a comment you must log in.
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Looks like this should do the job. I'll merge this and backport to Lucid as well

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox/parsers/udevadm.py'
2--- checkbox/parsers/udevadm.py 2012-02-28 11:09:34 +0000
3+++ checkbox/parsers/udevadm.py 2012-02-28 21:51:17 +0000
4@@ -343,9 +343,8 @@
5 for device in reversed(self._stack):
6 if device._environment.get("ID_BUS") == "usb":
7 return decode_id(device._environment["ID_MODEL_ENC"])
8-
9- if self._environment.get("DEVTYPE") == "disk" \
10- and self._environment.get("ID_BUS") in ("ata", "scsi","cciss"):
11+ elif self._environment.get("DEVTYPE") == "disk" \
12+ and "ID_MODEL_ENC" in self._environment:
13 return decode_id(self._environment["ID_MODEL_ENC"])
14
15 # floppy
16@@ -372,6 +371,9 @@
17 for device in reversed(self._stack):
18 if device._environment.get("ID_BUS") == "usb":
19 return decode_id(device._environment["ID_VENDOR_ENC"])
20+ elif self._environment.get("DEVTYPE") == "disk" \
21+ and "ID_VENDOR_ENC" in self._environment:
22+ return decode_id(self._environment["ID_VENDOR_ENC"])
23
24 return None
25

Subscribers

People subscribed via source and target branches