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

Proposed by Barry Price
Status: Merged
Merged at revision: 538631cb32334d32f2744d4118a8248aa340e5de
Proposed branch: ~barryprice/charm-canonical-livepatch/+git/canonical-livepatch-charm:master
Merge into: ~livepatch-charmers/charm-canonical-livepatch:master
Diff against target: 65 lines (+6/-7)
3 files modified
files/check_canonical-livepatch.py (+1/-1)
reactive/canonical_livepatch.py (+1/-2)
tests/99-autogen (+4/-4)
Reviewer Review Type Date Requested Status
Chris Stratford (community) Approve
Livepatch charm developers Pending
Review via email: mp+312571@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Stratford (chris-gondolin) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/check_canonical-livepatch.py b/files/check_canonical-livepatch.py
2index 8bf2646..3953661 100644
3--- a/files/check_canonical-livepatch.py
4+++ b/files/check_canonical-livepatch.py
5@@ -1,6 +1,6 @@
6 #!/usr/bin/env python
7
8-# Copyright (C) 2016 Barry Price <barry.price@canonical.com>
9+# Copyright (C) 2016 Canonical Ltd.
10
11 import os
12 import nagios_plugin
13diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
14index c131686..ce47d43 100644
15--- a/reactive/canonical_livepatch.py
16+++ b/reactive/canonical_livepatch.py
17@@ -164,8 +164,7 @@ def update_key():
18 hookenv.status_set('active', 'Ready')
19 else:
20 hookenv.log('Unable to activate canonical-livepatch as no key has been set')
21- # deactivating is a valid choice, so active/Ready rather than e.g. blocked/Deactivated
22- hookenv.status_set('active', 'Ready')
23+ hookenv.status_set('blocked', 'Service disabled, please set livepatch_key to activate')
24
25
26 @when('canonical-livepatch.connected')
27diff --git a/tests/99-autogen b/tests/99-autogen
28index 8521560..2906c27 100755
29--- a/tests/99-autogen
30+++ b/tests/99-autogen
31@@ -38,14 +38,14 @@ class TestDeployment(unittest.TestCase):
32
33 # verify the snap was installed
34 output, exit_code = livepatch.run('stat /snap/bin/canonical-livepatch')
35- self.assertTrue(exit_code == 0)
36+ self.assertTrue(exit_code, 0)
37
38 def test_status(self):
39 livepatch = self.deployment.sentry['canonical-livepatch'][0]
40
41 # run a status check - we expect this to return code 1 due to no access key
42 output, exit_code = livepatch.run('sudo canonical-livepatch status')
43- self.assertTrue(exit_code == 1)
44+ self.assertTrue(exit_code, 1)
45
46 def test_nagios_init(self):
47 livepatch = self.deployment.sentry['canonical-livepatch'][0]
48@@ -57,7 +57,7 @@ class TestDeployment(unittest.TestCase):
49 '/var/lib/nagios/canonical-livepatch-status.txt'
50 ]:
51 output, exit_code = livepatch.run('stat {}'.format(path))
52- self.assertTrue(exit_code == 0)
53+ self.assertTrue(exit_code, 0)
54
55 def test_nagios_servicegroup_change(self):
56 livepatch = self.deployment.sentry['canonical-livepatch'][0]
57@@ -73,7 +73,7 @@ class TestDeployment(unittest.TestCase):
58 output, exit_code = livepatch.run(
59 'grep {} /var/lib/nagios/export/service__*_check_canonical-livepatch.cfg'.format(test_servicegroup_name)
60 )
61- self.assertTrue(exit_code == 0)
62+ self.assertTrue(exit_code, 0)
63
64 if __name__ == '__main__':
65 unittest.main()

Subscribers

People subscribed via source and target branches