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

Proposed by Barry Price
Status: Merged
Approved by: Gareth Woolridge
Approved revision: 7f3efb4be5dd2f3560837b210d850ea7e1d75004
Merged at revision: 62884614f807ca2fc1a32cfa4b02161c6d9a5ced
Proposed branch: ~barryprice/charm-canonical-livepatch/+git/canonical-livepatch-charm:lp1778447
Merge into: ~livepatch-charmers/charm-canonical-livepatch:master
Diff against target: 49 lines (+9/-6)
1 file modified
files/check_canonical-livepatch.py (+9/-6)
Reviewer Review Type Date Requested Status
Gareth Woolridge Approve
Barry Price Approve
Review via email: mp+348747@code.launchpad.net

Commit message

Reverse fix for LP#1778447 as it seems to do the opposite

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 :

Let's see if I can +1 my own change

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

Change cannot be self approved, setting status to needs review.

Revision history for this message
Gareth Woolridge (moon127) wrote :

LGTM

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

Change successfully merged at revision 62884614f807ca2fc1a32cfa4b02161c6d9a5ced

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/files/check_canonical-livepatch.py b/files/check_canonical-livepatch.py
index 3a13062..4e6d54d 100755
--- a/files/check_canonical-livepatch.py
+++ b/files/check_canonical-livepatch.py
@@ -3,6 +3,7 @@
3# Copyright (C) 2016 Canonical Ltd.3# Copyright (C) 2016 Canonical Ltd.
44
5import os5import os
6import sys
6import nagios_plugin7import nagios_plugin
7from subprocess import check_output, call8from subprocess import check_output, call
89
@@ -16,7 +17,8 @@ def check_package_installed():
16 try:17 try:
17 check_output(cmd, universal_newlines=True)18 check_output(cmd, universal_newlines=True)
18 except Exception:19 except Exception:
19 raise nagios_plugin.CriticalError("canonical-livepatch snap is not installed")20 print("canonical-livepatch snap is not installed")
21 sys.exit(2)
2022
2123
22##############################################################################24##############################################################################
@@ -63,10 +65,12 @@ def check_status():
6365
64 if err_lines:66 if err_lines:
65 err = " ".join(err_lines)67 err = " ".join(err_lines)
66 raise nagios_plugin.CriticalError(err)68 print(err)
69 sys.exit(2)
67 elif wrn_lines:70 elif wrn_lines:
68 wrn = " ".join(wrn_lines)71 wrn = " ".join(wrn_lines)
69 raise nagios_plugin.WarnError(wrn)72 print(wrn)
73 sys.exit(1)
7074
7175
72def lsb_release():76def lsb_release():
@@ -104,9 +108,8 @@ def is_container():
104def main():108def main():
105 arch = os.uname()[4]109 arch = os.uname()[4]
106 if arch not in supported_archs:110 if arch not in supported_archs:
107 raise nagios_plugin.CriticalError(111 print("canonical-livepatch not supported on this architecture ({}).".format(arch))
108 "canonical-livepatch not supported on this architecture ({}).".format(arch)112 sys.exit(1)
109 )
110 elif is_container():113 elif is_container():
111 print("canonical-livepatch not needed in OS containers.")114 print("canonical-livepatch not needed in OS containers.")
112 else:115 else:

Subscribers

People subscribed via source and target branches