← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:charm-codehosting-reload-apache2 into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:charm-codehosting-reload-apache2 into launchpad:master.

Commit message:
charm: Reload apache2 on codehosting config changes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/455264

Since `branch-rewrite` is run by Apache, we need to reload Apache when configuration used by that script is changed.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charm-codehosting-reload-apache2 into launchpad:master.
diff --git a/charm/launchpad-codehosting/reactive/launchpad-codehosting.py b/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
index d0aeec6..5cee23e 100644
--- a/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
+++ b/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
@@ -201,10 +201,11 @@ def configure():
         ):
             hookenv.log(
                 "Config files changed; restarting"
-                " the launchpad-bzr-sftp service."
+                " the launchpad-bzr-sftp service and reloading apache2."
             )
             for i in range(config["workers"]):
                 host.service_restart(f"launchpad-bzr-sftp@{i + 1}")
+            host.service_reload("apache2")
         else:
             hookenv.log("Not restarting since no config files were changed.")
         host.service_resume("launchpad-bzr-sftp.service")