Merge ~vultaire/charm-hw-health:class-object-mismatch-patch into charm-hw-health:master

Proposed by Paul Goins
Status: Merged
Approved by: Paul Goins
Approved revision: 5222f826eb1bc402b847c648f7821804a35c87fe
Merged at revision: 5222f826eb1bc402b847c648f7821804a35c87fe
Proposed branch: ~vultaire/charm-hw-health:class-object-mismatch-patch
Merge into: charm-hw-health:master
Diff against target: 28 lines (+3/-4)
2 files modified
src/lib/hwhealth/hwdiscovery.py (+2/-2)
src/tests/unit/test_hwdiscovery.py (+1/-2)
Reviewer Review Type Date Requested Status
Drew Freiberger (community) Approve
BootStack Reviewers Pending
Review via email: mp+389105@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Drew Freiberger (afreiberger) wrote :

+1 on this method.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/lib/hwhealth/hwdiscovery.py b/src/lib/hwhealth/hwdiscovery.py
2index fe27403..5b0475e 100644
3--- a/src/lib/hwhealth/hwdiscovery.py
4+++ b/src/lib/hwhealth/hwdiscovery.py
5@@ -84,8 +84,8 @@ def _get_tools():
6 "System vendor not supported: {}".format(system_vendor), hookenv.DEBUG
7 )
8
9- executed_toolset = set([tool() for tool in toolset if tool.is_series_supported])
10- return executed_toolset
11+ toolset = set(tool for tool in toolset if tool.is_series_supported)
12+ return toolset
13
14
15 def _supports_mdadm():
16diff --git a/src/tests/unit/test_hwdiscovery.py b/src/tests/unit/test_hwdiscovery.py
17index e3d660c..1694e76 100644
18--- a/src/tests/unit/test_hwdiscovery.py
19+++ b/src/tests/unit/test_hwdiscovery.py
20@@ -67,8 +67,7 @@ class TestGetTools(unittest.TestCase):
21 mock_hw.return_value = Hardware(filename=sample)
22 basename = os.path.basename(sample)
23 with self.subTest(msg="Subtest {}".format(basename)):
24- actual_instances = hwhealth.hwdiscovery.get_tools()
25- actual_classes = {tool.__class__ for tool in actual_instances}
26+ actual_classes = hwhealth.hwdiscovery.get_tools()
27 expected = self.EXPECTED_TOOLS.get(basename)
28 self.assertEqual(actual_classes, expected)
29

Subscribers

People subscribed via source and target branches

to all changes: