Merge lp:~abentley/charms/trusty/juju-reports/disable-cron into lp:~juju-qa/charms/trusty/juju-reports/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 55
Proposed branch: lp:~abentley/charms/trusty/juju-reports/disable-cron
Merge into: lp:~juju-qa/charms/trusty/juju-reports/trunk
Diff against target: 25 lines (+4/-0)
2 files modified
config.yaml (+1/-0)
hooks/common.py (+3/-0)
To merge this branch: bzr merge lp:~abentley/charms/trusty/juju-reports/disable-cron
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+250942@code.launchpad.net

Commit message

cron-interval=-1 disables cron.

Description of the change

This branch tweaks the juju-reports charm to provide a way to disable cron scripts.

Developers will typically want to run the scripts by hand, and not have cron running automatically. Now they can set cron-interval to -1 to achieve that.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-02-20 19:54:48 +0000
3+++ config.yaml 2015-02-25 15:29:08 +0000
4@@ -4,6 +4,7 @@
5 default: 60
6 description: |
7 The amount of time (in minutes) between cron jobs for the app.
8+ -1 to disable cron.
9 source:
10 type: string
11 default: lp:juju-reports
12
13=== modified file 'hooks/common.py'
14--- hooks/common.py 2015-02-20 19:54:48 +0000
15+++ hooks/common.py 2015-02-25 15:29:08 +0000
16@@ -357,6 +357,9 @@
17 hookenv.log('Not setting up cron because {} not set.'.format(
18 ', '.join(unset)))
19 update_cronjob(None)
20+ elif config['cron-interval'] == -1:
21+ hookenv.log('Cron disabled by cron-interval = -1')
22+ update_cronjob(None)
23 else:
24 install_cronjob(config['cron-interval'], config['error-email'])
25 stop()

Subscribers

People subscribed via source and target branches