Merge lp:~timkuhlman/charms/trusty/grafana/layer-grafana-http into lp:~canonical-is-sa/charms/trusty/grafana/layer-grafana

Proposed by Tim Kuhlman
Status: Merged
Merged at revision: 36
Proposed branch: lp:~timkuhlman/charms/trusty/grafana/layer-grafana-http
Merge into: lp:~canonical-is-sa/charms/trusty/grafana/layer-grafana
Diff against target: 64 lines (+15/-3)
4 files modified
config.yaml (+6/-1)
layer.yaml (+1/-1)
metadata.yaml (+2/-0)
reactive/grafana.py (+6/-1)
To merge this branch: bzr merge lp:~timkuhlman/charms/trusty/grafana/layer-grafana-http
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Review via email: mp+293458@code.launchpad.net

Description of the change

Added a website relation, specifically so it can be related to the apache charm which will easily add an https + openid frontend.

To post a comment you must log in.
Revision history for this message
Tom Haddon (mthaddon) wrote :

Looks good, merging.

review: Approve
36. By Tom Haddon

[timkuhlman,r=mthaddon] Added a website relation, specifically so it can be related to the apache charm which will easily add an https + openid frontend

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 2016-04-27 16:42:30 +0000
3+++ config.yaml 2016-04-29 23:34:37 +0000
4@@ -61,8 +61,13 @@
5 type: string
6 description: |
7 Comma separated list of nagios servicegroups for the graphite check
8+ port:
9+ type: string
10+ default: "3000"
11+ description: |
12+ The port grafana will expose web services on.
13 admin_password:
14- default:
15+ default: ""
16 type: string
17 description: |
18 Grafana admin password. Default, pwgen(16) random password
19
20=== modified file 'layer.yaml'
21--- layer.yaml 2016-04-13 16:43:03 +0000
22+++ layer.yaml 2016-04-29 23:34:37 +0000
23@@ -1,2 +1,2 @@
24-includes: ['layer:basic', 'interface:nrpe-external-master', 'interface:grafana-source']
25+includes: ['layer:basic', 'interface:nrpe-external-master', 'interface:grafana-source', 'interface:http']
26 ignore: ['.*.swp' ]
27
28=== modified file 'metadata.yaml'
29--- metadata.yaml 2016-04-27 13:46:26 +0000
30+++ metadata.yaml 2016-04-29 23:34:37 +0000
31@@ -12,6 +12,8 @@
32 nrpe-external-master:
33 interface: nrpe-external-master
34 scope: container
35+ website:
36+ interface: http
37 requires:
38 grafana-source:
39 interface: grafana-source
40
41=== modified file 'reactive/grafana.py'
42--- reactive/grafana.py 2016-04-27 16:42:30 +0000
43+++ reactive/grafana.py 2016-04-29 23:34:37 +0000
44@@ -77,7 +77,7 @@
45 owner='root', group='grafana',
46 perms=0o640,
47 )
48- check_ports(config.get('port', '3000'))
49+ check_ports(config.get('port'))
50 set_state('grafana.start')
51 hookenv.status_set('active', 'Ready')
52
53@@ -148,6 +148,11 @@
54 pass
55
56
57+@when('website.available')
58+def configure_website(website):
59+ website.configure(port=hookenv.config('port'))
60+
61+
62 def validate_datasources():
63 """TODO: make sure datasources option is merged with
64 relation data

Subscribers

People subscribed via source and target branches

to all changes: