Merge ~ballot/charm-canonical-livepatch/+git/charm-canonical-livepatch:lp1926438 into charm-canonical-livepatch:master

Proposed by Benjamin Allot
Status: Merged
Approved by: Drew Freiberger
Approved revision: 45c46a9a8bc5fdd07eaeca348f5a37040a45f625
Merged at revision: 2761cbb8cb954ebf398552bedf81255db912eb8e
Proposed branch: ~ballot/charm-canonical-livepatch/+git/charm-canonical-livepatch:lp1926438
Merge into: charm-canonical-livepatch:master
Diff against target: 40 lines (+10/-6)
2 files modified
src/reactive/canonical_livepatch.py (+9/-6)
src/wheelhouse.txt (+1/-0)
Reviewer Review Type Date Requested Status
Drew Freiberger (community) Approve
Junien F Approve
Barry Price Approve
Review via email: mp+402003@code.launchpad.net

Commit message

Restore charm functionality on Trusty

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
Barry Price (barryprice) wrote :

LGTM +1

review: Approve
Revision history for this message
Junien F (axino) wrote :

+1

review: Approve
Revision history for this message
Drew Freiberger (afreiberger) wrote :

Tested fine on bionic. xenial test fails with lp#1916672, known issue.

Trusty works now.

Merging, then stripping off to stable/trusty so that wheelhouse tenacity doesn't update further for trusty clients.

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

Change successfully merged at revision 2761cbb8cb954ebf398552bedf81255db912eb8e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/canonical_livepatch.py b/src/reactive/canonical_livepatch.py
2index c1720e3..e4a8540 100644
3--- a/src/reactive/canonical_livepatch.py
4+++ b/src/reactive/canonical_livepatch.py
5@@ -57,19 +57,22 @@ def unit_update(status=None, message=None):
6 if status and message:
7 hookenv.status_set(status, message)
8 else:
9- revision = ''
10- if path.exists('version'):
11- with open('version') as f:
12+ revision = ""
13+ if path.exists("version"):
14+ with open("version") as f:
15 line = f.readline().strip()
16 # We only want the first 8 characters, that's enough to tell
17 # which version of the charm we're using.
18 if len(line) > 8:
19- revision = ' (source version/commit {}…)'.format(line[:8])
20+ revision = " (source version/commit {}…)".format(line[:8])
21 else:
22- revision = ' (source version/commit {})'.format(line)
23+ revision = " (source version/commit {})".format(line)
24 patch_details = get_patch_details()
25 hookenv.status_set(
26- "active", "Running kernel {}, patchState: {}{}".format(*patch_details, revision)
27+ "active",
28+ "Running kernel {}, patchState: {}{}".format(
29+ patch_details[0], patch_details[1], revision
30+ ),
31 )
32
33
34diff --git a/src/wheelhouse.txt b/src/wheelhouse.txt
35index 6af63cd..dac3eef 100644
36--- a/src/wheelhouse.txt
37+++ b/src/wheelhouse.txt
38@@ -1 +1,2 @@
39 charmhelpers>=0.11.0
40+typing

Subscribers

People subscribed via source and target branches

to all changes: