Merge ~vultaire/charm-hw-health:wait-for-vendor-apt-fix into charm-hw-health:master

Proposed by Paul Goins
Status: Merged
Approved by: Paul Goins
Approved revision: f948c8a18cac714ec2ddd082d1bb0fb37753321e
Merged at revision: 2602e4fe150b4b1a21327eecf115be80a29da449
Proposed branch: ~vultaire/charm-hw-health:wait-for-vendor-apt-fix
Merge into: charm-hw-health:master
Diff against target: 18 lines (+4/-3)
1 file modified
src/reactive/hw_health.py (+4/-3)
Reviewer Review Type Date Requested Status
Drew Freiberger (community) Approve
BootStack Reviewers Pending
Review via email: mp+389134@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Drew Freiberger (afreiberger) wrote :

quick refactor to limit instantiation if class is not subclass of AptVendorTool

review: Needs Fixing
Revision history for this message
Paul Goins (vultaire) :
Revision history for this message
Drew Freiberger (afreiberger) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/hw_health.py b/src/reactive/hw_health.py
2index ff72e85..b902348 100644
3--- a/src/reactive/hw_health.py
4+++ b/src/reactive/hw_health.py
5@@ -111,9 +111,10 @@ def wait_for_vendor_apt():
6 for tool_class_name in unitdb.get("toolset", set()):
7 # Re-instantiate the tool from the saved class name
8 tool_class = getattr(tools, tool_class_name)
9- if isinstance(tool_class, tools.AptVendorTool):
10- if tool_class.is_apt_installed():
11- tool_class.install_cronjob()
12+ tool = tool_class()
13+ if isinstance(tool, tools.AptVendorTool):
14+ if tool.is_apt_installed():
15+ tool.install_cronjob()
16 else:
17 status.maintenance("Waiting for vendor tools to install via apt")
18 return

Subscribers

People subscribed via source and target branches

to all changes: