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

Proposed by Haw Loeung
Status: Merged
Approved by: Thomas Cuthbert
Approved revision: 0857aa7a718fa491da26a1cee990da6073b77402
Merged at revision: 9f6355f31cf64e71743ad752885f7c35dbc66f21
Proposed branch: ~hloeung/content-cache-charm:cleanup
Merge into: content-cache-charm:master
Diff against target: 58 lines (+5/-6)
3 files modified
lib/haproxy.py (+1/-2)
tests/unit/files/content_cache_rendered_haproxy_test_output.txt (+2/-2)
tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt (+2/-2)
Reviewer Review Type Date Requested Status
Thomas Cuthbert (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+380936@code.launchpad.net

Commit message

Fixed to use the correct backend when multiples exist

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
Thomas Cuthbert (tcuthbert) wrote :

LGTM +1

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

Change successfully merged at revision 9f6355f31cf64e71743ad752885f7c35dbc66f21

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/haproxy.py b/lib/haproxy.py
2index e3a4d38..b8d8727 100644
3--- a/lib/haproxy.py
4+++ b/lib/haproxy.py
5@@ -142,8 +142,7 @@ listen {name}
6 tls_config = ' ssl {}'.format(' '.join(['crt {}'.format(path) for path in paths]))
7
8 if len(backend_config) == 1:
9- backend = backend_config[0].split()[1]
10- backend_config = ['{indent}default_backend {backend}\n'.format(backend=backend, indent=INDENT)]
11+ backend_config = ['{indent}default_backend backend-{backend}\n'.format(backend=name, indent=INDENT)]
12
13 bind_config = '{indent}bind {address_port}{tls}'.format(
14 address_port=address_port, tls=tls_config, indent=INDENT
15diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
16index 8dd0a37..fddd98a 100644
17--- a/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
18+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output.txt
19@@ -97,7 +97,7 @@ listen site5
20
21 listen site5-2
22 bind 127.0.0.1:8084
23- default_backend backend-site5
24+ default_backend backend-site5-2
25
26 listen site6-local
27 bind 127.0.0.1:8085
28@@ -119,7 +119,7 @@ listen site8-local
29
30 listen site8-local-2
31 bind 127.0.0.1:8088
32- default_backend backend-site8-local
33+ default_backend backend-site8-local-2
34
35 listen site9-local
36 bind 127.0.0.1:8089
37diff --git a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
38index a0abcc9..f7ad762 100644
39--- a/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
40+++ b/tests/unit/files/content_cache_rendered_haproxy_test_output_auto_maxconns.txt
41@@ -97,7 +97,7 @@ listen site5
42
43 listen site5-2
44 bind 127.0.0.1:8084
45- default_backend backend-site5
46+ default_backend backend-site5-2
47
48 listen site6-local
49 bind 127.0.0.1:8085
50@@ -119,7 +119,7 @@ listen site8-local
51
52 listen site8-local-2
53 bind 127.0.0.1:8088
54- default_backend backend-site8-local
55+ default_backend backend-site8-local-2
56
57 listen site9-local
58 bind 127.0.0.1:8089

Subscribers

People subscribed via source and target branches