Merge ~sylvain-pineau/checkbox-support:udevadm_export_list_only into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 5a311080d91ca75dc72cbca471dca807b0723ed3
Merged at revision: 4adef42051dd0f90b0f09c889de67ea8e0337cba
Proposed branch: ~sylvain-pineau/checkbox-support:udevadm_export_list_only
Merge into: checkbox-support:master
Diff against target: 30 lines (+3/-3)
2 files modified
checkbox_support/parsers/tests/test_udevadm.py (+1/-1)
checkbox_support/parsers/udevadm.py (+2/-2)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+321660@code.launchpad.net

Description of the change

little patch to allow the new tarball submission format to contain a json export based on dicts (and not a dict of list of dict...)

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

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/tests/test_udevadm.py b/checkbox_support/parsers/tests/test_udevadm.py
2index 4764aa2..7303181 100644
3--- a/checkbox_support/parsers/tests/test_udevadm.py
4+++ b/checkbox_support/parsers/tests/test_udevadm.py
5@@ -93,7 +93,7 @@ class TestUdevadmParser(TestCase, UdevadmDataMixIn):
6 if with_lsblk:
7 lsblk = self.get_lsblk(name)
8 return parse_udevadm_output(
9- self.get_text(name), lsblk, 64)["devices"]
10+ self.get_text(name), lsblk, 64)
11
12 def count(self, devices, category):
13 return len([d for d in devices if d.category == category])
14diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
15index 3954252..953a4f6 100644
16--- a/checkbox_support/parsers/udevadm.py
17+++ b/checkbox_support/parsers/udevadm.py
18@@ -1117,10 +1117,10 @@ def known_to_be_video_device(vendor_id, product_id, pci_class, pci_subclass):
19
20 class UdevResult(object):
21 def __init__(self):
22- self.devices = {"devices": []}
23+ self.devices = []
24
25 def addDevice(self, device):
26- self.devices["devices"].append(device)
27+ self.devices.append(device)
28
29
30 def parse_udevadm_output(output, lsblk=None, bits=None):

Subscribers

People subscribed via source and target branches