Merge ~hloeung/content-cache-charm:master into content-cache-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Barry Price
Approved revision: f4d4201ab24a71ade29a32bd2b55a6d16d53575d
Merged at revision: d075d33c0d3beb54ca15f69c2b207b6c1bd3f629
Proposed branch: ~hloeung/content-cache-charm:master
Merge into: content-cache-charm:master
Diff against target: 57 lines (+7/-4)
1 file modified
reactive/content_cache.py (+7/-4)
Reviewer Review Type Date Requested Status
Barry Price Approve
Review via email: mp+365145@code.launchpad.net

Commit message

Fixed states so we're not stuck on 'maintenance, setting up NRPE checks'

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
Barry Price (barryprice) wrote :

Makes sense, +1

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

Change successfully merged at revision d075d33c0d3beb54ca15f69c2b207b6c1bd3f629

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/content_cache.py b/reactive/content_cache.py
2index d3480cb..7cbbc73 100644
3--- a/reactive/content_cache.py
4+++ b/reactive/content_cache.py
5@@ -58,11 +58,13 @@ def service_start_or_restart(name):
6
7 @reactive.when_not('content_cache.nginx.configured')
8 def configure_nginx():
9+ status.maintenance('setting up Nginx as caching layer')
10+ reactive.clear_flag('content_cache.active')
11+
12 config = hookenv.config()
13
14 if not config.get('sites'):
15 status.blocked('requires list of sites to configure')
16- reactive.clear_flag('content_cache.active')
17 return
18
19 ngx_conf = nginx.NginxConf()
20@@ -70,7 +72,6 @@ def configure_nginx():
21 sites = sites_from_config(config.get('sites'), sites_secrets)
22 if not sites:
23 status.blocked('list of sites provided has no backends or seems invalid')
24- reactive.clear_flag('content_cache.active')
25 return
26
27 changed = False
28@@ -97,11 +98,13 @@ def configure_nginx():
29
30 @reactive.when_not('content_cache.haproxy.configured')
31 def configure_haproxy():
32+ status.maintenance('setting up HAProxy for frontend and backend proxy')
33+ reactive.clear_flag('content_cache.active')
34+
35 config = hookenv.config()
36
37 if not config.get('sites'):
38 status.blocked('requires list of sites to configure')
39- reactive.clear_flag('content_cache.active')
40 return
41
42 haproxy = HAProxy.HAProxyConf()
43@@ -109,7 +112,6 @@ def configure_haproxy():
44 sites = sites_from_config(config.get('sites'), sites_secrets)
45 if not sites:
46 status.blocked('list of sites provided has no backends or seems invalid')
47- reactive.clear_flag('content_cache.active')
48 return
49
50 num_procs = multiprocessing.cpu_count()
51@@ -165,6 +167,7 @@ def configure_haproxy():
52 @reactive.when_not('nagios-nrpe.configured')
53 def configure_nagios():
54 status.maintenance('setting up NRPE checks')
55+ reactive.clear_flag('content_cache.active')
56
57 config = hookenv.config()
58

Subscribers

People subscribed via source and target branches