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
diff --git a/lib/haproxy.py b/lib/haproxy.py
index b715a7e..f4b6387 100644
--- a/lib/haproxy.py
+++ b/lib/haproxy.py
@@ -60,14 +60,13 @@ class HAProxyConf:
60 if tls_cert_bundle_path:60 if tls_cert_bundle_path:
61 default_port = 44361 default_port = 443
62 if config[site].get('redirect-http-to-https'):62 if config[site].get('redirect-http-to-https'):
63 new['0.0.0.0:80'][site_name] = {}63 new.setdefault('0.0.0.0:80', {})
64 # We use a different flag/config here so it's only enabled64 # We use a different flag/config here so it's only enabled
65 # on the HTTP, and not the HTTPS, stanza.65 # on the HTTP, and not the HTTPS, stanza.
66 new['0.0.0.0:80'][site_name]['enable-redirect-http-to-https'] = True66 new['0.0.0.0:80'][site_name] = {'enable-redirect-http-to-https': True}
67 port = config[site].get('port', default_port)67 port = config[site].get('port', default_port)
68 name = '{}:{}'.format(listen_address, port)68 name = '{}:{}'.format(listen_address, port)
69 if name not in new:69 new.setdefault(name, {})
70 new[name] = {}
71 new[name][site] = config[site]70 new[name][site] = config[site]
72 new[name][site]['port'] = port71 new[name][site]['port'] = port
7372
@@ -75,8 +74,7 @@ class HAProxyConf:
75 if 'backend_port' in loc_conf:74 if 'backend_port' in loc_conf:
76 port = loc_conf['backend_port']75 port = loc_conf['backend_port']
77 name = '{}:{}'.format(listen_address, port)76 name = '{}:{}'.format(listen_address, port)
78 if name not in new:77 new.setdefault(name, {})
79 new[name] = {}
80 count = 278 count = 2
81 new_site = site79 new_site = site
82 while new_site in new[name]:80 while new_site in new[name]:

Subscribers

People subscribed via source and target branches