Merge ~lgp171188/launchpad:fix-launchpad-codehosting-config-changed-handler-when_any-instead-of-when into launchpad:master

Proposed by Guruprasad
Status: Merged
Approved by: Guruprasad
Approved revision: 4ab9dd318fbcbae115c8b6d87dbf5db0b6abe7d0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~lgp171188/launchpad:fix-launchpad-codehosting-config-changed-handler-when_any-instead-of-when
Merge into: launchpad:master
Diff against target: 30 lines (+3/-2)
1 file modified
charm/launchpad-codehosting/reactive/launchpad-codehosting.py (+3/-2)
Reviewer Review Type Date Requested Status
Simone Pelosi Approve
Review via email: mp+461014@code.launchpad.net

Commit message

charm/launchpad-codehosting: Use the when_any decorator for config.changed.<option>

This should fix the bug and allow the handler to run when any of the
options are changed, instead of when all of them are changed.

To post a comment you must log in.
Revision history for this message
Simone Pelosi (pelpsi) wrote (last edit ):

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/launchpad-codehosting/reactive/launchpad-codehosting.py b/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
2index f8cd61f..073480b 100644
3--- a/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
4+++ b/charm/launchpad-codehosting/reactive/launchpad-codehosting.py
5@@ -21,6 +21,7 @@ from charms.reactive import (
6 set_flag,
7 set_state,
8 when,
9+ when_any,
10 when_not,
11 when_not_all,
12 )
13@@ -429,7 +430,7 @@ def configure_frontend_loadbalancer():
14 set_state("launchpad-codehosting.frontend-loadbalancer.configured")
15
16
17-@when(
18+@when_any(
19 "config.changed.haproxy_service_options_http",
20 "config.changed.haproxy_service_options_https",
21 "config.changed.haproxy_service_options_ssh",
22@@ -488,7 +489,7 @@ def configure_loadbalancer():
23 set_state("launchpad-codehosting.loadbalancer.configured")
24
25
26-@when(
27+@when_any(
28 "config.changed.haproxy_service_options_internal_branch_by_id",
29 "config.changed.haproxy_server_options",
30 "config.changed.port_bzr_internal",

Subscribers

People subscribed via source and target branches

to status/vote changes: