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
diff --git a/checkbox_support/parsers/tests/test_udevadm.py b/checkbox_support/parsers/tests/test_udevadm.py
index 28fab5a..69a4ac3 100644
--- a/checkbox_support/parsers/tests/test_udevadm.py
+++ b/checkbox_support/parsers/tests/test_udevadm.py
@@ -93,7 +93,7 @@ class TestUdevadmParser(TestCase, UdevadmDataMixIn):
93 if with_lsblk:93 if with_lsblk:
94 lsblk = self.get_lsblk(name)94 lsblk = self.get_lsblk(name)
95 return parse_udevadm_output(95 return parse_udevadm_output(
96 self.get_text(name), lsblk, 64)["device_list"]96 self.get_text(name), lsblk, 64)["devices"]
9797
98 def count(self, devices, category):98 def count(self, devices, category):
99 return len([d for d in devices if d.category == category])99 return len([d for d in devices if d.category == category])
diff --git a/checkbox_support/parsers/udevadm.py b/checkbox_support/parsers/udevadm.py
index ef79a88..18e5b8e 100644
--- a/checkbox_support/parsers/udevadm.py
+++ b/checkbox_support/parsers/udevadm.py
@@ -1033,10 +1033,10 @@ def known_to_be_video_device(vendor_id, product_id, pci_class, pci_subclass):
10331033
1034class UdevResult(object):1034class UdevResult(object):
1035 def __init__(self):1035 def __init__(self):
1036 self.devices = {"device_list": []}1036 self.devices = {"devices": []}
10371037
1038 def addDevice(self, device):1038 def addDevice(self, device):
1039 self.devices["device_list"].append(device)1039 self.devices["devices"].append(device)
10401040
10411041
1042def parse_udevadm_output(output, lsblk=None, bits=None):1042def parse_udevadm_output(output, lsblk=None, bits=None):

Subscribers

People subscribed via source and target branches