Merge lp:~caio1982/capomastro/mta-charm into lp:~ubuntuone-hackers/capomastro/charm

Proposed by Caio Begotti
Status: Merged
Approved by: Caio Begotti
Approved revision: 66
Merged at revision: 66
Proposed branch: lp:~caio1982/capomastro/mta-charm
Merge into: lp:~ubuntuone-hackers/capomastro/charm
Diff against target: 68 lines (+28/-0)
4 files modified
config.yaml (+12/-0)
hooks/config-changed (+5/-0)
inc/common (+5/-0)
templates/capomastro_local_settings.tmpl (+6/-0)
To merge this branch: bzr merge lp:~caio1982/capomastro/mta-charm
Reviewer Review Type Date Requested Status
Sheila Miguez (community) Approve
Review via email: mp+255271@code.launchpad.net

Description of the change

These changes are necessary to have Capomastro sending e-mails when builds finish (with whatever status). The spec will be updated later with the settings Prodstack/Staging expect, as discussed with IS last Friday.

To post a comment you must log in.
Revision history for this message
Sheila Miguez (codersquid) wrote :

LGTM

review: Approve

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-19 00:59:50 +0000
3+++ config.yaml 2015-04-06 14:48:56 +0000
4@@ -39,6 +39,18 @@
5 type: string
6 default: "capomastro"
7 description: "The superuser default password"
8+ email_from:
9+ type: string
10+ default: "Capomastro <noreply@localhost>"
11+ description: "The From: field of notifications e-mails"
12+ email_host:
13+ type: string
14+ default: "localhost"
15+ description: "The e-mail host to use for sending notifications"
16+ email_port:
17+ type: string
18+ default: "25"
19+ description: "The e-mail host port, usually 25 (plain) or 587 (SSL)"
20 superemail:
21 type: string
22 default: "capomastro@localhost"
23
24=== modified file 'hooks/config-changed'
25--- hooks/config-changed 2015-03-17 13:42:18 +0000
26+++ hooks/config-changed 2015-04-06 14:48:56 +0000
27@@ -89,6 +89,11 @@
28 export t_app_allowed_hosts="'${sitename}', '${private_address}'"
29 fi
30
31+# MTA variables
32+export t_email_from=${email_from}
33+export t_email_host=${email_host}
34+export t_email_port=${email_port}
35+
36 juju-log "Fixing up local settings of Capomastro..."
37 cheetah fill --env --stdout templates/capomastro_local_settings.tmpl > ${app_config}
38
39
40=== modified file 'inc/common'
41--- inc/common 2014-12-16 16:53:12 +0000
42+++ inc/common 2015-04-06 14:48:56 +0000
43@@ -21,6 +21,11 @@
44 django_superpassword=$(config-get superpassword)
45 django_superemail=$(config-get superemail)
46
47+# for the mta template part
48+email_from=$(config-get email_from)
49+email_host=$(config-get email_host)
50+email_port=$(config-get email_port)
51+
52 # postresql customization and defaults
53 db_name=$(config-get dbname)
54 db_user=$(config-get dbuser)
55
56=== modified file 'templates/capomastro_local_settings.tmpl'
57--- templates/capomastro_local_settings.tmpl 2015-02-03 18:25:53 +0000
58+++ templates/capomastro_local_settings.tmpl 2015-04-06 14:48:56 +0000
59@@ -10,3 +10,9 @@
60
61 # Note this should be a URL that Jenkins can access your Django application.
62 NOTIFICATION_HOST = "http://${t_app_notification_host}/"
63+
64+# Django ignores the system MTA so you need it set up in here
65+EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
66+DEFAULT_FROM_EMAIL = "${t_email_from}"
67+EMAIL_HOST = "${t_email_host}"
68+EMAIL_PORT = "${t_email_port}"

Subscribers

People subscribed via source and target branches