Merge lp:~thomir-deactivatedaccount/charm-haproxy/make-config-less-insane into lp:charm-haproxy

Proposed by Thomi Richards
Status: Superseded
Proposed branch: lp:~thomir-deactivatedaccount/charm-haproxy/make-config-less-insane
Merge into: lp:charm-haproxy
Diff against target: 59 lines (+20/-12)
2 files modified
files/nrpe/check_haproxy_queue_depth.sh (+2/-2)
hooks/hooks.py (+18/-10)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/charm-haproxy/make-config-less-insane
Reviewer Review Type Date Requested Status
haproxy-team Pending
Review via email: mp+328010@code.launchpad.net

This proposal has been superseded by a proposal from 2017-07-25.

To post a comment you must log in.

Unmerged revisions

119. By Thomi Richards

Use <> instead of {} since {} is yaml token for a dictionary.

118. By Thomi Richards

Fixed failing test.

117. By Thomi Richards

Code cleanups.

116. By Thomi Richards

Code cleanups.

115. By Thomi Richards

Code cleanups.

114. By Thomi Richards

Code cleanups.

113. By Thomi Richards

Consolidate two loops.

112. By Thomi Richards

Fix service option filtering.

111. By Thomi Richards

Hack in a way for users to force an option to a particular section of the config.

110. By William Grant

Increase nagios haproxy queue depth thresholds until they're configurable.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'files/nrpe/check_haproxy_queue_depth.sh'
--- files/nrpe/check_haproxy_queue_depth.sh 2015-05-12 15:10:44 +0000
+++ files/nrpe/check_haproxy_queue_depth.sh 2017-07-25 07:56:43 +0000
@@ -7,8 +7,8 @@
7# Author: Tom Haddon7# Author: Tom Haddon
88
9# These should be config options at some stage9# These should be config options at some stage
10CURRQthrsh=010CURRQthrsh=10
11MAXQthrsh=10011MAXQthrsh=500
1212
13AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}')13AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}')
1414
1515
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2016-11-22 11:15:13 +0000
+++ hooks/hooks.py 2017-07-25 07:56:43 +0000
@@ -347,16 +347,24 @@
347 if any(map(o.strip().startswith, service_options)):347 if any(map(o.strip().startswith, service_options)):
348 fe_options.append(o)348 fe_options.append(o)
349 be_options.append(o)349 be_options.append(o)
350
350 # Filter provided service options into frontend-only and backend-only.351 # Filter provided service options into frontend-only and backend-only.
351 results = izip(352 # XXX: The '<FE>' and '<BE>' feature is a local patch in this version
352 (fe_options, be_options),353 # of the charm, and is not present in the upstream charm.
353 (True, False),354 for option in service_options:
354 tee((o, any(map(o.strip().startswith,355 option = option.strip()
355 frontend_only_options)))356 if option.startswith('<FE>'):
356 for o in service_options))357 fe_options.append(option[4:].strip())
357 for out, cond, result in results:358 elif option.startswith('<BE>'):
358 out.extend(option for option, match in result359 be_options.append(option[4:].strip())
359 if match is cond and option not in out)360 else:
361 if any(map(option.startswith, frontend_only_options)):
362 if option not in fe_options:
363 fe_options.append(option)
364 else:
365 if option not in be_options:
366 be_options.append(option)
367
360 service_config = []368 service_config = []
361 unit_name = os.environ["JUJU_UNIT_NAME"].replace("/", "-")369 unit_name = os.environ["JUJU_UNIT_NAME"].replace("/", "-")
362 service_config.append("frontend %s-%s" % (unit_name, service_port))370 service_config.append("frontend %s-%s" % (unit_name, service_port))
@@ -795,7 +803,7 @@
795 service_name,803 service_name,
796 service_config['service_host'],804 service_config['service_host'],
797 service_config['service_port'],805 service_config['service_port'],
798 service_config['service_options'],806 service_config.get('service_options', []),
799 server_entries, errorfiles, crts, backends))807 server_entries, errorfiles, crts, backends))
800808
801809

Subscribers

People subscribed via source and target branches

to all changes: