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
1diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
2index 7c0b559..de797ec 100644
3--- a/reactive/canonical_livepatch.py
4+++ b/reactive/canonical_livepatch.py
5@@ -183,7 +183,7 @@ def activate_livepatch():
6 register_trigger(when='config.changed.livepatch_proxy', clear_flag='livepatch-proxy.configured')
7
8
9-@when_not('snap.installed.canonical-livepatch')
10+@when('snap.installed.canonical-livepatch')
11 def livepatch_supported():
12 arch = uname()[4]
13 opts = layer.options('snap')
14@@ -191,11 +191,13 @@ def livepatch_supported():
15 if supported_archs and arch not in supported_archs:
16 hookenv.log('Livepatch does not currently support {} architecture'.format(arch))
17 unit_update('blocked', 'Architecture {} is not supported by livepatch'.format(arch))
18- if is_container():
19+ elif is_container():
20 hookenv.log('OS container detected, livepatch is not needed')
21 unit_update('blocked', 'Livepatch is not needed in OS containers')
22+ else:
23+ set_flag('canonical-livepatch.supported')
24
25-
26+@when('canonical-livepatch.supported')
27 @when_not('livepatch-proxy.configured')
28 def proxy_configure():
29 # Configure proxies early, if required - LP#1761661

Subscribers

People subscribed via source and target branches