Merge ~cjwatson/lp-codeimport:charm-conditional-rabbitmq-job into lp-codeimport:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: d886a4bab2d27d45e17412b23b46460223a0df22
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/lp-codeimport:charm-conditional-rabbitmq-job
Merge into: lp-codeimport:master
Diff against target: 15 lines (+2/-0)
1 file modified
charm/lp-codeimport/templates/crontab.j2 (+2/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+439748@code.launchpad.net

Commit message

charm: Only enable datedir2amqp if RabbitMQ is configured

Description of the change

Development deployments might not have RabbitMQ set up (used for error reporting), and we don't want to set up a broken cron job in that case.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This is pretty trivial, so I'll just self-approve it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/lp-codeimport/templates/crontab.j2 b/charm/lp-codeimport/templates/crontab.j2
2index b3cfdc0..51c549f 100644
3--- a/charm/lp-codeimport/templates/crontab.j2
4+++ b/charm/lp-codeimport/templates/crontab.j2
5@@ -11,9 +11,11 @@ LP_PY={{ code_dir }}/bin/py
6
7 2 1 * * * {{ scripts_dir }}/clean_importd_logs.sh
8
9+{% if rabbitmq_host and rabbitmq_user and rabbitmq_password and rabbitmq_virtual_host -%}
10 # OOPS amqp
11 */15 * * * * {{ code_dir }}/bin/datedir2amqp --exchange oopses --host {{ rabbitmq_host }} --username {{ rabbitmq_user }} --password {{ rabbitmq_password }} --vhost {{ rabbitmq_virtual_host }} --repo {{ oopses_dir }} --key ""
12
13+{% endif -%}
14 # Work around https://bugs.launchpad.net/lp-codeimport/+bug/810288
15 5 * * * * find /tmp -ignore_readdir_race -maxdepth 1 -type f \( -name 'tmp*.pack' -o -name 'tmp*.idx' \) -mtime +3 -delete
16

Subscribers

People subscribed via source and target branches