launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29764
[Merge] ~cjwatson/launchpad:charm-appserver-memcache-changed into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:charm-appserver-memcache-changed into launchpad:master.
Commit message:
charm: Reconfigure appserver when memcache relation changes
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/439076
This ensures that we update the appserver's configuration if (for example) a `memcached` unit is removed.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charm-appserver-memcache-changed into launchpad:master.
diff --git a/charm/launchpad-appserver/reactive/launchpad-appserver.py b/charm/launchpad-appserver/reactive/launchpad-appserver.py
index 2fcc9b6..339344d 100644
--- a/charm/launchpad-appserver/reactive/launchpad-appserver.py
+++ b/charm/launchpad-appserver/reactive/launchpad-appserver.py
@@ -16,6 +16,8 @@ from charms.launchpad.base import (
from charms.reactive import (
clear_flag,
helpers,
+ hook,
+ remove_state,
set_flag,
set_state,
when,
@@ -146,6 +148,11 @@ def check_is_running():
hookenv.status_set("active", "Ready")
+@hook("{requires:memcache}-relation-{joined,changed,broken,departed}")
+def memcache_relation_changed(memcache):
+ remove_state("service.configured")
+
+
@when("nrpe-external-master.available", "service.configured")
@when_not("launchpad.appserver.nrpe-external-master.published")
def nrpe_available(nrpe):
Follow ups