Merge lp:~tvansteenburgh/charms/precise/haproxy/fix-proof-and-tests into lp:charms/haproxy

Proposed by Tim Van Steenburgh on 2014-09-08
Status: Merged
Merged at revision: 83
Proposed branch: lp:~tvansteenburgh/charms/precise/haproxy/fix-proof-and-tests
Merge into: lp:charms/haproxy
Diff against target: 404 lines (+313/-4)
7 files modified
Makefile (+7/-2)
README.md (+1/-1)
config.yaml (+5/-0)
hooks/hooks.py (+3/-0)
hooks/tests/test_helpers.py (+4/-0)
icon.svg (+292/-0)
metadata.yaml (+1/-1)
To merge this branch: bzr merge lp:~tvansteenburgh/charms/precise/haproxy/fix-proof-and-tests
Reviewer Review Type Date Requested Status
Matt Bruzek (community) 2014-09-08 Approve on 2014-09-11
Review via email: mp+233784@code.launchpad.net

Description of the change

Fixes charm-proof and `make test`.

To post a comment you must log in.
Kevin W Monroe (kwmonroe) wrote :

LGTM Tim. Thanks for your contribution ;)

Matt Bruzek (mbruzek) wrote :

+1 LGTM charm tests pass on hp-cloud! Thanks for your work here Tim! You are awesome!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2013-10-24 17:23:07 +0000
3+++ Makefile 2014-09-08 19:18:44 +0000
4@@ -17,9 +17,14 @@
5 @(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK
6 @test `cat revision` = 0 && rm revision
7
8-test:
9+.venv:
10+ sudo apt-get install python-apt
11+ virtualenv .venv --system-site-packages
12+ .venv/bin/pip install -I nose testtools mock pyyaml
13+
14+test: .venv
15 @echo Starting tests...
16- @CHARM_DIR=$(CHARM_DIR) $(TEST_PREFIX) nosetests -s $(TEST_DIR)
17+ @CHARM_DIR=$(CHARM_DIR) $(TEST_PREFIX) .venv/bin/nosetests -s $(TEST_DIR)
18
19 lint:
20 @echo Checking for Python syntax...
21
22=== modified file 'README.md'
23--- README.md 2014-05-27 18:48:09 +0000
24+++ README.md 2014-09-08 19:18:44 +0000
25@@ -97,7 +97,7 @@
26 sudo apt-get install python-software-properties
27 sudo add-apt-repository ppa:cjohnston/flake8
28 sudo apt-get update
29- sudo apt-get install python-mock python-flake8 python-nose python-nosexcover
30+ sudo apt-get install python-mock python-flake8 python-nose python-nosexcover python-testtools charm-tools
31
32 To run the tests:
33
34
35=== modified file 'config.yaml'
36--- config.yaml 2014-05-27 22:43:44 +0000
37+++ config.yaml 2014-09-08 19:18:44 +0000
38@@ -34,6 +34,11 @@
39 the same physical server. With the help of this parameter, it becomes
40 possible to add some randomness in the check interval between 0 and
41 +/- 50%. A value between 2 and 5 seems to show good results.
42+ global_stats_socket:
43+ default: False
44+ type: boolean
45+ description: |
46+ Whether to enable the stats UNIX socket.
47 default_log:
48 default: "global"
49 type: string
50
51=== modified file 'hooks/hooks.py'
52--- hooks/hooks.py 2014-05-29 14:46:46 +0000
53+++ hooks/hooks.py 2014-09-08 19:18:44 +0000
54@@ -137,6 +137,9 @@
55 haproxy_globals.append(" quiet")
56 haproxy_globals.append(" spread-checks %d" %
57 config_data['global_spread_checks'])
58+ if config_data['global_stats_socket'] is True:
59+ sock_path = "/var/run/haproxy/haproxy.sock"
60+ haproxy_globals.append(" stats socket %s mode 0600" % sock_path)
61 return '\n'.join(haproxy_globals)
62
63
64
65=== modified file 'hooks/tests/test_helpers.py'
66--- hooks/tests/test_helpers.py 2013-12-17 16:00:29 +0000
67+++ hooks/tests/test_helpers.py 2014-09-08 19:18:44 +0000
68@@ -23,9 +23,11 @@
69 'global_spread_checks': 234,
70 'global_debug': False,
71 'global_quiet': False,
72+ 'global_stats_socket': True,
73 }
74 result = hooks.create_haproxy_globals()
75
76+ sock_path = "/var/run/haproxy/haproxy.sock"
77 expected = '\n'.join([
78 'global',
79 ' log foo-log',
80@@ -34,6 +36,7 @@
81 ' user foo-user',
82 ' group foo-group',
83 ' spread-checks 234',
84+ ' stats socket %s mode 0600' % sock_path,
85 ])
86 self.assertEqual(result, expected)
87
88@@ -47,6 +50,7 @@
89 'global_spread_checks': 234,
90 'global_debug': True,
91 'global_quiet': True,
92+ 'global_stats_socket': False,
93 }
94 result = hooks.create_haproxy_globals()
95
96
97=== added file 'icon.svg'
98--- icon.svg 1970-01-01 00:00:00 +0000
99+++ icon.svg 2014-09-08 19:18:44 +0000
100@@ -0,0 +1,292 @@
101+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
102+<!-- Created with Inkscape (http://www.inkscape.org/) -->
103+
104+<svg
105+ xmlns:dc="http://purl.org/dc/elements/1.1/"
106+ xmlns:cc="http://creativecommons.org/ns#"
107+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
108+ xmlns:svg="http://www.w3.org/2000/svg"
109+ xmlns="http://www.w3.org/2000/svg"
110+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
111+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
112+ width="96"
113+ height="96"
114+ id="svg6517"
115+ version="1.1"
116+ inkscape:version="0.48.4 r9939"
117+ sodipodi:docname="juju-icon-placeholder-h.svg">
118+ <defs
119+ id="defs6519">
120+ <linearGradient
121+ id="Background">
122+ <stop
123+ id="stop4178"
124+ offset="0"
125+ style="stop-color:#b8b8b8;stop-opacity:1" />
126+ <stop
127+ id="stop4180"
128+ offset="1"
129+ style="stop-color:#c9c9c9;stop-opacity:1" />
130+ </linearGradient>
131+ <filter
132+ style="color-interpolation-filters:sRGB;"
133+ inkscape:label="Inner Shadow"
134+ id="filter1121">
135+ <feFlood
136+ flood-opacity="0.59999999999999998"
137+ flood-color="rgb(0,0,0)"
138+ result="flood"
139+ id="feFlood1123" />
140+ <feComposite
141+ in="flood"
142+ in2="SourceGraphic"
143+ operator="out"
144+ result="composite1"
145+ id="feComposite1125" />
146+ <feGaussianBlur
147+ in="composite1"
148+ stdDeviation="1"
149+ result="blur"
150+ id="feGaussianBlur1127" />
151+ <feOffset
152+ dx="0"
153+ dy="2"
154+ result="offset"
155+ id="feOffset1129" />
156+ <feComposite
157+ in="offset"
158+ in2="SourceGraphic"
159+ operator="atop"
160+ result="composite2"
161+ id="feComposite1131" />
162+ </filter>
163+ <filter
164+ style="color-interpolation-filters:sRGB;"
165+ inkscape:label="Drop Shadow"
166+ id="filter950">
167+ <feFlood
168+ flood-opacity="0.25"
169+ flood-color="rgb(0,0,0)"
170+ result="flood"
171+ id="feFlood952" />
172+ <feComposite
173+ in="flood"
174+ in2="SourceGraphic"
175+ operator="in"
176+ result="composite1"
177+ id="feComposite954" />
178+ <feGaussianBlur
179+ in="composite1"
180+ stdDeviation="1"
181+ result="blur"
182+ id="feGaussianBlur956" />
183+ <feOffset
184+ dx="0"
185+ dy="1"
186+ result="offset"
187+ id="feOffset958" />
188+ <feComposite
189+ in="SourceGraphic"
190+ in2="offset"
191+ operator="over"
192+ result="composite2"
193+ id="feComposite960" />
194+ <feBlend
195+ blend="normal"
196+ id="feBlend3895"
197+ in2="composite2" />
198+ </filter>
199+ <clipPath
200+ clipPathUnits="userSpaceOnUse"
201+ id="clipPath873">
202+ <g
203+ transform="matrix(0,-0.66666667,0.66604479,0,-258.25992,677.00001)"
204+ id="g875"
205+ inkscape:label="Layer 1"
206+ style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline">
207+ <path
208+ style="fill:#ff00ff;fill-opacity:1;stroke:none;display:inline"
209+ d="m 46.702703,898.22775 50.594594,0 C 138.16216,898.22775 144,904.06497 144,944.92583 l 0,50.73846 c 0,40.86071 -5.83784,46.69791 -46.702703,46.69791 l -50.594594,0 C 5.8378378,1042.3622 0,1036.525 0,995.66429 L 0,944.92583 C 0,904.06497 5.8378378,898.22775 46.702703,898.22775 Z"
210+ id="path877"
211+ inkscape:connector-curvature="0"
212+ sodipodi:nodetypes="sssssssss" />
213+ </g>
214+ </clipPath>
215+ <filter
216+ inkscape:collect="always"
217+ id="filter891"
218+ inkscape:label="Badge Shadow">
219+ <feGaussianBlur
220+ inkscape:collect="always"
221+ stdDeviation="0.71999962"
222+ id="feGaussianBlur893" />
223+ </filter>
224+ </defs>
225+ <sodipodi:namedview
226+ id="base"
227+ pagecolor="#ffffff"
228+ bordercolor="#666666"
229+ borderopacity="1.0"
230+ inkscape:pageopacity="0.0"
231+ inkscape:pageshadow="2"
232+ inkscape:zoom="8.1490724"
233+ inkscape:cx="6.3116087"
234+ inkscape:cy="46.975739"
235+ inkscape:document-units="px"
236+ inkscape:current-layer="layer3"
237+ showgrid="true"
238+ fit-margin-top="0"
239+ fit-margin-left="0"
240+ fit-margin-right="0"
241+ fit-margin-bottom="0"
242+ inkscape:window-width="1849"
243+ inkscape:window-height="1218"
244+ inkscape:window-x="123"
245+ inkscape:window-y="68"
246+ inkscape:window-maximized="0"
247+ showborder="true"
248+ showguides="true"
249+ inkscape:guide-bbox="true"
250+ inkscape:showpageshadow="false">
251+ <inkscape:grid
252+ type="xygrid"
253+ id="grid821" />
254+ <sodipodi:guide
255+ orientation="1,0"
256+ position="16,48"
257+ id="guide823" />
258+ <sodipodi:guide
259+ orientation="0,1"
260+ position="64,80"
261+ id="guide825" />
262+ <sodipodi:guide
263+ orientation="1,0"
264+ position="80,40"
265+ id="guide827" />
266+ <sodipodi:guide
267+ orientation="0,1"
268+ position="64,16"
269+ id="guide829" />
270+ </sodipodi:namedview>
271+ <metadata
272+ id="metadata6522">
273+ <rdf:RDF>
274+ <cc:Work
275+ rdf:about="">
276+ <dc:format>image/svg+xml</dc:format>
277+ <dc:type
278+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
279+ <dc:title />
280+ </cc:Work>
281+ </rdf:RDF>
282+ </metadata>
283+ <g
284+ inkscape:label="BACKGROUND"
285+ inkscape:groupmode="layer"
286+ id="layer1"
287+ transform="translate(268,-635.29076)"
288+ style="display:inline">
289+ <path
290+ style="fill:#333333;fill-opacity:0.93333334000000001;stroke:none;display:inline;filter:url(#filter1121);opacity:0.7"
291+ d="m -268,700.15563 0,-33.72973 c 0,-27.24324 3.88785,-31.13513 31.10302,-31.13513 l 33.79408,0 c 27.21507,0 31.1029,3.89189 31.1029,31.13513 l 0,33.72973 c 0,27.24325 -3.88783,31.13514 -31.1029,31.13514 l -33.79408,0 C -264.11215,731.29077 -268,727.39888 -268,700.15563 Z"
292+ id="path6455"
293+ inkscape:connector-curvature="0"
294+ sodipodi:nodetypes="sssssssss" />
295+ </g>
296+ <g
297+ inkscape:groupmode="layer"
298+ id="layer3"
299+ inkscape:label="PLACEHOLDER LETTER"
300+ style="display:inline">
301+ <text
302+ xml:space="preserve"
303+ style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;filter:url(#filter950);font-family:Sans"
304+ x="31.452"
305+ y="69.1772"
306+ id="text3891"
307+ sodipodi:linespacing="125%"><tspan
308+ sodipodi:role="line"
309+ id="tspan3893"
310+ x="31.452"
311+ y="69.1772"
312+ style="font-size:56px;font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;fill:#ffffff;fill-opacity:1;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Medium">h</tspan></text>
313+ <rect
314+ style="opacity:0.7;fill:none;stroke:none"
315+ id="rect3021"
316+ width="64"
317+ height="64"
318+ x="16"
319+ y="15.449201" />
320+ </g>
321+ <g
322+ inkscape:groupmode="layer"
323+ id="layer2"
324+ inkscape:label="BADGE"
325+ style="display:none"
326+ sodipodi:insensitive="true">
327+ <g
328+ style="display:inline"
329+ transform="translate(-340.00001,-581)"
330+ id="g4394"
331+ clip-path="none">
332+ <g
333+ id="g855">
334+ <g
335+ inkscape:groupmode="maskhelper"
336+ id="g870"
337+ clip-path="url(#clipPath873)"
338+ style="opacity:0.6;filter:url(#filter891)">
339+ <path
340+ transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-237.54282)"
341+ d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z"
342+ sodipodi:ry="12"
343+ sodipodi:rx="12"
344+ sodipodi:cy="552.36218"
345+ sodipodi:cx="252"
346+ id="path844"
347+ style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
348+ sodipodi:type="arc" />
349+ </g>
350+ <g
351+ id="g862">
352+ <path
353+ sodipodi:type="arc"
354+ style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
355+ id="path4398"
356+ sodipodi:cx="252"
357+ sodipodi:cy="552.36218"
358+ sodipodi:rx="12"
359+ sodipodi:ry="12"
360+ d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z"
361+ transform="matrix(1.4999992,0,0,1.4999992,-29.999795,-238.54282)" />
362+ <path
363+ transform="matrix(1.25,0,0,1.25,33,-100.45273)"
364+ d="m 264,552.36218 c 0,6.62742 -5.37258,12 -12,12 -6.62742,0 -12,-5.37258 -12,-12 0,-6.62741 5.37258,-12 12,-12 6.62742,0 12,5.37259 12,12 z"
365+ sodipodi:ry="12"
366+ sodipodi:rx="12"
367+ sodipodi:cy="552.36218"
368+ sodipodi:cx="252"
369+ id="path4400"
370+ style="color:#000000;fill:#dd4814;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
371+ sodipodi:type="arc" />
372+ <path
373+ sodipodi:type="star"
374+ style="color:#000000;fill:#f5f5f5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
375+ id="path4459"
376+ sodipodi:sides="5"
377+ sodipodi:cx="666.19574"
378+ sodipodi:cy="589.50385"
379+ sodipodi:r1="7.2431178"
380+ sodipodi:r2="4.3458705"
381+ sodipodi:arg1="1.0471976"
382+ sodipodi:arg2="1.6755161"
383+ inkscape:flatsided="false"
384+ inkscape:rounded="0.1"
385+ inkscape:randomized="0"
386+ d="m 669.8173,595.77657 c -0.39132,0.22593 -3.62645,-1.90343 -4.07583,-1.95066 -0.44938,-0.0472 -4.05653,1.36297 -4.39232,1.06062 -0.3358,-0.30235 0.68963,-4.03715 0.59569,-4.47913 -0.0939,-0.44198 -2.5498,-3.43681 -2.36602,-3.8496 0.18379,-0.41279 4.05267,-0.59166 4.44398,-0.81759 0.39132,-0.22593 2.48067,-3.48704 2.93005,-3.4398 0.44938,0.0472 1.81505,3.67147 2.15084,3.97382 0.3358,0.30236 4.08294,1.2817 4.17689,1.72369 0.0939,0.44198 -2.9309,2.86076 -3.11469,3.27355 -0.18379,0.41279 0.0427,4.27917 -0.34859,4.5051 z"
387+ transform="matrix(1.511423,-0.16366377,0.16366377,1.511423,-755.37346,-191.93651)" />
388+ </g>
389+ </g>
390+ </g>
391+ </g>
392+</svg>
393
394=== modified file 'metadata.yaml'
395--- metadata.yaml 2013-08-21 22:10:24 +0000
396+++ metadata.yaml 2014-09-08 19:18:44 +0000
397@@ -1,6 +1,6 @@
398 name: haproxy
399 summary: "fast and reliable load balancing reverse proxy"
400-maintainer: [Juan Negron <juan@ubuntu.com>, Tom Haddon <tom.haddon@canonical.com>]
401+maintainers: [Juan Negron <juan@ubuntu.com>, Tom Haddon <tom.haddon@canonical.com>]
402 description:
403 HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high
404 availability environments. It features connection persistence through HTTP

Subscribers

People subscribed via source and target branches