Merge ~barryprice/charm-canonical-livepatch/+git/canonical-livepatch-charm:master into ~livepatch-charmers/charm-canonical-livepatch:master

Proposed by Barry Price
Status: Merged
Approved by: Barry Price
Approved revision: 6dc44e2a044dd0cd82a4e07275fadcb43c8ea633
Merged at revision: 26c99618e50c9103236913a303f720ee13c3ba9a
Proposed branch: ~barryprice/charm-canonical-livepatch/+git/canonical-livepatch-charm:master
Merge into: ~livepatch-charmers/charm-canonical-livepatch:master
Diff against target: 29 lines (+5/-3)
1 file modified
reactive/canonical_livepatch.py (+5/-3)
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+348326@code.launchpad.net

Commit message

Properly trap/detect unsupported installs

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Stuart Bishop (stub) wrote :

Looks good. The livepatch-proxy.configured flag name change is only partially complete, so this either needs to be finished or reverted. The flag names are inconsistent no matter which way you swing ;)

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 26c99618e50c9103236913a303f720ee13c3ba9a

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
index 7c0b559..de797ec 100644
--- a/reactive/canonical_livepatch.py
+++ b/reactive/canonical_livepatch.py
@@ -183,7 +183,7 @@ def activate_livepatch():
183register_trigger(when='config.changed.livepatch_proxy', clear_flag='livepatch-proxy.configured')183register_trigger(when='config.changed.livepatch_proxy', clear_flag='livepatch-proxy.configured')
184184
185185
186@when_not('snap.installed.canonical-livepatch')186@when('snap.installed.canonical-livepatch')
187def livepatch_supported():187def livepatch_supported():
188 arch = uname()[4]188 arch = uname()[4]
189 opts = layer.options('snap')189 opts = layer.options('snap')
@@ -191,11 +191,13 @@ def livepatch_supported():
191 if supported_archs and arch not in supported_archs:191 if supported_archs and arch not in supported_archs:
192 hookenv.log('Livepatch does not currently support {} architecture'.format(arch))192 hookenv.log('Livepatch does not currently support {} architecture'.format(arch))
193 unit_update('blocked', 'Architecture {} is not supported by livepatch'.format(arch))193 unit_update('blocked', 'Architecture {} is not supported by livepatch'.format(arch))
194 if is_container():194 elif is_container():
195 hookenv.log('OS container detected, livepatch is not needed')195 hookenv.log('OS container detected, livepatch is not needed')
196 unit_update('blocked', 'Livepatch is not needed in OS containers')196 unit_update('blocked', 'Livepatch is not needed in OS containers')
197 else:
198 set_flag('canonical-livepatch.supported')
197199
198200@when('canonical-livepatch.supported')
199@when_not('livepatch-proxy.configured')201@when_not('livepatch-proxy.configured')
200def proxy_configure():202def proxy_configure():
201 # Configure proxies early, if required - LP#1761661203 # Configure proxies early, if required - LP#1761661

Subscribers

People subscribed via source and target branches