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: Haw Loeung
Approved revision: 0e63f436969e348e2348b240decb26e4f0914f64
Merged at revision: 257535a699d5d13f53dda4d78b286268da611227
Proposed branch: ~barryprice/charm-canonical-livepatch/+git/canonical-livepatch-charm:master
Merge into: ~livepatch-charmers/charm-canonical-livepatch:master
Diff against target: 20 lines (+2/-1)
2 files modified
files/check_canonical-livepatch.cron (+1/-1)
reactive/canonical_livepatch.py (+1/-0)
Reviewer Review Type Date Requested Status
Haw Loeung Approve
Review via email: mp+358613@code.launchpad.net

Commit message

Don't generate nagios checks or cron spam in containers (or on unsupported architectures)

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
Haw Loeung (hloeung) wrote :

LGTM, +1

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

Change successfully merged at revision 257535a699d5d13f53dda4d78b286268da611227

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/check_canonical-livepatch.cron b/files/check_canonical-livepatch.cron
2index 6457c12..05d4515 100644
3--- a/files/check_canonical-livepatch.cron
4+++ b/files/check_canonical-livepatch.cron
5@@ -1,2 +1,2 @@
6 # check_canonical-livepatch
7-17,47 * * * * root /snap/bin/canonical-livepatch status > /var/lib/nagios/canonical-livepatch-status.txt
8+17,47 * * * * root [ -x /snap/bin/canonical-livepatch ] && /snap/bin/canonical-livepatch status > /var/lib/nagios/canonical-livepatch-status.txt
9diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
10index 3f30019..533e5a7 100644
11--- a/reactive/canonical_livepatch.py
12+++ b/reactive/canonical_livepatch.py
13@@ -248,6 +248,7 @@ def change_channel():
14 # Set up Nagios checks when the nrpe-external-master subordinate is related
15 @when('nrpe-external-master.available')
16 @when_not('canonical-livepatch.nagios-setup.complete')
17+@when('canonical-livepatch.supported')
18 def configure_nagios(nagios):
19 if hookenv.hook_name() == 'update-status':
20 return

Subscribers

People subscribed via source and target branches