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

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 2f623da301162d2d78360699b965982a7cbe447e
Merged at revision: 4a4656c49585dc5208b0a52cf17c40bf8b1b6723
Proposed branch: ~hloeung/content-cache-charm:cleanup
Merge into: content-cache-charm:master
Diff against target: 32 lines (+4/-6)
1 file modified
lib/haproxy.py (+4/-6)
Reviewer Review Type Date Requested Status
Joel Sing (community) +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+374203@code.launchpad.net

Commit message

Fixed, this was removed to reduce complexity but breaks redirect-http-to-https

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
Joel Sing (jsing) wrote :

LGTM

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

Change successfully merged at revision 4a4656c49585dc5208b0a52cf17c40bf8b1b6723

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 b715a7e..f4b6387 100644
3--- a/lib/haproxy.py
4+++ b/lib/haproxy.py
5@@ -60,14 +60,13 @@ class HAProxyConf:
6 if tls_cert_bundle_path:
7 default_port = 443
8 if config[site].get('redirect-http-to-https'):
9- new['0.0.0.0:80'][site_name] = {}
10+ new.setdefault('0.0.0.0:80', {})
11 # We use a different flag/config here so it's only enabled
12 # on the HTTP, and not the HTTPS, stanza.
13- new['0.0.0.0:80'][site_name]['enable-redirect-http-to-https'] = True
14+ new['0.0.0.0:80'][site_name] = {'enable-redirect-http-to-https': True}
15 port = config[site].get('port', default_port)
16 name = '{}:{}'.format(listen_address, port)
17- if name not in new:
18- new[name] = {}
19+ new.setdefault(name, {})
20 new[name][site] = config[site]
21 new[name][site]['port'] = port
22
23@@ -75,8 +74,7 @@ class HAProxyConf:
24 if 'backend_port' in loc_conf:
25 port = loc_conf['backend_port']
26 name = '{}:{}'.format(listen_address, port)
27- if name not in new:
28- new[name] = {}
29+ new.setdefault(name, {})
30 count = 2
31 new_site = site
32 while new_site in new[name]:

Subscribers

People subscribed via source and target branches