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

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 6974ae553230ad4441b47efb87cb6628149790c6
Merged at revision: 422f901aa56475382d2933c07c16204f656eb9ea
Proposed branch: ~sylvain-pineau/checkbox-support:new_json_exporter
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+308756@code.launchpad.net

Description of the change

A name change for the top level udevadm result object, to match what C3 expects after a submission parsing.

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

It's no op change for the udev_resource script from the resource provider.

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 28fab5a..69a4ac3 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)["device_list"]
10+ self.get_text(name), lsblk, 64)["devices"]
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 ef79a88..18e5b8e 100644
16--- a/checkbox_support/parsers/udevadm.py
17+++ b/checkbox_support/parsers/udevadm.py
18@@ -1033,10 +1033,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 = {"device_list": []}
23+ self.devices = {"devices": []}
24
25 def addDevice(self, device):
26- self.devices["device_list"].append(device)
27+ self.devices["devices"].append(device)
28
29
30 def parse_udevadm_output(output, lsblk=None, bits=None):

Subscribers

People subscribed via source and target branches