Merge lp:~jamesbeedy/charms/trusty/fiche/next into lp:~jamesbeedy/charms/trusty/fiche/trunk
- Trusty Tahr (14.04)
- next
- Merge into trunk
Proposed by
james beedy
Status: | Merged |
---|---|
Merged at revision: | 4 |
Proposed branch: | lp:~jamesbeedy/charms/trusty/fiche/next |
Merge into: | lp:~jamesbeedy/charms/trusty/fiche/trunk |
Diff against target: |
818 lines (+348/-112) 22 files modified
.gitignore (+60/-0) Makefile (+1/-1) hooks/config-changed (+4/-3) hooks/hook.template (+4/-3) hooks/install (+4/-3) hooks/leader-elected (+4/-3) hooks/leader-settings-changed (+4/-3) hooks/start (+4/-3) hooks/stop (+4/-3) hooks/update-status (+4/-3) hooks/upgrade-charm (+10/-4) hooks/website-relation-broken (+4/-3) hooks/website-relation-changed (+4/-3) hooks/website-relation-departed (+4/-3) hooks/website-relation-joined (+4/-3) layer.yaml (+2/-0) lib/charms/layer/__init__.py (+21/-0) lib/charms/layer/basic.py (+114/-0) metadata.yaml (+1/-1) reactive/fiche.py (+65/-22) tests/10-deploy (+26/-27) unit_tests/test_actions.py (+0/-21) |
To merge this branch: | bzr merge lp:~jamesbeedy/charms/trusty/fiche/next |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
james beedy | Pending | ||
Review via email: mp+287549@code.launchpad.net |
Commit message
Description of the change
Merge next.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.gitignore' | |||
2 | --- .gitignore 1970-01-01 00:00:00 +0000 | |||
3 | +++ .gitignore 2016-02-29 23:22:49 +0000 | |||
4 | @@ -0,0 +1,60 @@ | |||
5 | 1 | #### joe made this: http://goel.io/joe | ||
6 | 2 | |||
7 | 3 | #####=== Python ===##### | ||
8 | 4 | |||
9 | 5 | # Byte-compiled / optimized / DLL files | ||
10 | 6 | __pycache__/ | ||
11 | 7 | *.py[cod] | ||
12 | 8 | |||
13 | 9 | # C extensions | ||
14 | 10 | *.so | ||
15 | 11 | |||
16 | 12 | # Distribution / packaging | ||
17 | 13 | .Python | ||
18 | 14 | env/ | ||
19 | 15 | build/ | ||
20 | 16 | develop-eggs/ | ||
21 | 17 | dist/ | ||
22 | 18 | downloads/ | ||
23 | 19 | eggs/ | ||
24 | 20 | lib64/ | ||
25 | 21 | parts/ | ||
26 | 22 | sdist/ | ||
27 | 23 | var/ | ||
28 | 24 | *.egg-info/ | ||
29 | 25 | .installed.cfg | ||
30 | 26 | *.egg | ||
31 | 27 | |||
32 | 28 | # PyInstaller | ||
33 | 29 | # Usually these files are written by a python script from a template | ||
34 | 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
35 | 31 | *.manifest | ||
36 | 32 | *.spec | ||
37 | 33 | |||
38 | 34 | # Installer logs | ||
39 | 35 | pip-log.txt | ||
40 | 36 | pip-delete-this-directory.txt | ||
41 | 37 | |||
42 | 38 | # Unit test / coverage reports | ||
43 | 39 | htmlcov/ | ||
44 | 40 | .tox/ | ||
45 | 41 | .coverage | ||
46 | 42 | .cache | ||
47 | 43 | nosetests.xml | ||
48 | 44 | coverage.xml | ||
49 | 45 | |||
50 | 46 | # Translations | ||
51 | 47 | *.mo | ||
52 | 48 | *.pot | ||
53 | 49 | |||
54 | 50 | # Django stuff: | ||
55 | 51 | *.log | ||
56 | 52 | |||
57 | 53 | # Sphinx documentation | ||
58 | 54 | docs/_build/ | ||
59 | 55 | |||
60 | 56 | # PyBuilder | ||
61 | 57 | target/ | ||
62 | 58 | |||
63 | 59 | deps | ||
64 | 60 | trusty | ||
65 | 0 | 61 | ||
66 | === modified file 'Makefile' | |||
67 | --- Makefile 2016-01-12 22:40:14 +0000 | |||
68 | +++ Makefile 2016-02-29 23:22:49 +0000 | |||
69 | @@ -8,7 +8,7 @@ | |||
70 | 8 | juju-compose -o ~/charms . | 8 | juju-compose -o ~/charms . |
71 | 9 | 9 | ||
72 | 10 | lint: | 10 | lint: |
74 | 11 | @flake8 --exclude hooks/charmhelpers hooks unit_tests tests | 11 | @flake8 $(wildcard hooks unit_tests tests) |
75 | 12 | @charm proof | 12 | @charm proof |
76 | 13 | 13 | ||
77 | 14 | unit_test: | 14 | unit_test: |
78 | 15 | 15 | ||
79 | === modified file 'hooks/config-changed' | |||
80 | --- hooks/config-changed 2016-01-12 22:40:14 +0000 | |||
81 | +++ hooks/config-changed 2016-02-29 23:22:49 +0000 | |||
82 | @@ -4,15 +4,16 @@ | |||
83 | 4 | import sys | 4 | import sys |
84 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
85 | 6 | 6 | ||
88 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
89 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
90 | 9 | basic.init_config_states() | ||
91 | 9 | 10 | ||
92 | 10 | 11 | ||
93 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
94 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
95 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
96 | 14 | # | 15 | # |
98 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
99 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
100 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
101 | 18 | main() | 19 | main() |
102 | 19 | 20 | ||
103 | === modified file 'hooks/hook.template' | |||
104 | --- hooks/hook.template 2016-01-12 22:40:14 +0000 | |||
105 | +++ hooks/hook.template 2016-02-29 23:22:49 +0000 | |||
106 | @@ -4,15 +4,16 @@ | |||
107 | 4 | import sys | 4 | import sys |
108 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
109 | 6 | 6 | ||
112 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
113 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
114 | 9 | basic.init_config_states() | ||
115 | 9 | 10 | ||
116 | 10 | 11 | ||
117 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
118 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
119 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
120 | 14 | # | 15 | # |
122 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
123 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
124 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
125 | 18 | main() | 19 | main() |
126 | 19 | 20 | ||
127 | === modified file 'hooks/install' | |||
128 | --- hooks/install 2016-01-12 22:40:14 +0000 | |||
129 | +++ hooks/install 2016-02-29 23:22:49 +0000 | |||
130 | @@ -4,15 +4,16 @@ | |||
131 | 4 | import sys | 4 | import sys |
132 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
133 | 6 | 6 | ||
136 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
137 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
138 | 9 | basic.init_config_states() | ||
139 | 9 | 10 | ||
140 | 10 | 11 | ||
141 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
142 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
143 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
144 | 14 | # | 15 | # |
146 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
147 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
148 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
149 | 18 | main() | 19 | main() |
150 | 19 | 20 | ||
151 | === modified file 'hooks/leader-elected' | |||
152 | --- hooks/leader-elected 2016-01-12 22:40:14 +0000 | |||
153 | +++ hooks/leader-elected 2016-02-29 23:22:49 +0000 | |||
154 | @@ -4,15 +4,16 @@ | |||
155 | 4 | import sys | 4 | import sys |
156 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
157 | 6 | 6 | ||
160 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
161 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
162 | 9 | basic.init_config_states() | ||
163 | 9 | 10 | ||
164 | 10 | 11 | ||
165 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
166 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
167 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
168 | 14 | # | 15 | # |
170 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
171 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
172 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
173 | 18 | main() | 19 | main() |
174 | 19 | 20 | ||
175 | === modified file 'hooks/leader-settings-changed' | |||
176 | --- hooks/leader-settings-changed 2016-01-12 22:40:14 +0000 | |||
177 | +++ hooks/leader-settings-changed 2016-02-29 23:22:49 +0000 | |||
178 | @@ -4,15 +4,16 @@ | |||
179 | 4 | import sys | 4 | import sys |
180 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
181 | 6 | 6 | ||
184 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
185 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
186 | 9 | basic.init_config_states() | ||
187 | 9 | 10 | ||
188 | 10 | 11 | ||
189 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
190 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
191 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
192 | 14 | # | 15 | # |
194 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
195 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
196 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
197 | 18 | main() | 19 | main() |
198 | 19 | 20 | ||
199 | === modified file 'hooks/start' | |||
200 | --- hooks/start 2016-01-12 22:40:14 +0000 | |||
201 | +++ hooks/start 2016-02-29 23:22:49 +0000 | |||
202 | @@ -4,15 +4,16 @@ | |||
203 | 4 | import sys | 4 | import sys |
204 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
205 | 6 | 6 | ||
208 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
209 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
210 | 9 | basic.init_config_states() | ||
211 | 9 | 10 | ||
212 | 10 | 11 | ||
213 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
214 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
215 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
216 | 14 | # | 15 | # |
218 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
219 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
220 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
221 | 18 | main() | 19 | main() |
222 | 19 | 20 | ||
223 | === modified file 'hooks/stop' | |||
224 | --- hooks/stop 2016-01-12 22:40:14 +0000 | |||
225 | +++ hooks/stop 2016-02-29 23:22:49 +0000 | |||
226 | @@ -4,15 +4,16 @@ | |||
227 | 4 | import sys | 4 | import sys |
228 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
229 | 6 | 6 | ||
232 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
233 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
234 | 9 | basic.init_config_states() | ||
235 | 9 | 10 | ||
236 | 10 | 11 | ||
237 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
238 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
239 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
240 | 14 | # | 15 | # |
242 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
243 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
244 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
245 | 18 | main() | 19 | main() |
246 | 19 | 20 | ||
247 | === modified file 'hooks/update-status' | |||
248 | --- hooks/update-status 2016-01-12 22:40:14 +0000 | |||
249 | +++ hooks/update-status 2016-02-29 23:22:49 +0000 | |||
250 | @@ -4,15 +4,16 @@ | |||
251 | 4 | import sys | 4 | import sys |
252 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
253 | 6 | 6 | ||
256 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
257 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
258 | 9 | basic.init_config_states() | ||
259 | 9 | 10 | ||
260 | 10 | 11 | ||
261 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
262 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
263 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
264 | 14 | # | 15 | # |
266 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
267 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
268 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
269 | 18 | main() | 19 | main() |
270 | 19 | 20 | ||
271 | === modified file 'hooks/upgrade-charm' | |||
272 | --- hooks/upgrade-charm 2016-01-12 22:40:14 +0000 | |||
273 | +++ hooks/upgrade-charm 2016-02-29 23:22:49 +0000 | |||
274 | @@ -6,17 +6,23 @@ | |||
275 | 6 | sys.path.append('lib') | 6 | sys.path.append('lib') |
276 | 7 | 7 | ||
277 | 8 | # This is an upgrade-charm context, make sure we install latest deps | 8 | # This is an upgrade-charm context, make sure we install latest deps |
279 | 9 | os.unlink('wheelhouse/.bootstrapped') | 9 | if not os.path.exists('wheelhouse/.upgrade'): |
280 | 10 | open('wheelhouse/.upgrade', 'w').close() | ||
281 | 11 | if os.path.exists('wheelhouse/.bootstrapped'): | ||
282 | 12 | os.unlink('wheelhouse/.bootstrapped') | ||
283 | 13 | else: | ||
284 | 14 | os.unlink('wheelhouse/.upgrade') | ||
285 | 10 | 15 | ||
288 | 11 | from charms.bootstrap import bootstrap_charm_deps | 16 | from charms.layer import basic |
289 | 12 | bootstrap_charm_deps() | 17 | basic.bootstrap_charm_deps() |
290 | 18 | basic.init_config_states() | ||
291 | 13 | 19 | ||
292 | 14 | 20 | ||
293 | 15 | # This will load and run the appropriate @hook and other decorated | 21 | # This will load and run the appropriate @hook and other decorated |
294 | 16 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 22 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
295 | 17 | # and $CHARM_DIR/hooks/relations. | 23 | # and $CHARM_DIR/hooks/relations. |
296 | 18 | # | 24 | # |
298 | 19 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 25 | # See https://jujucharms.com/docs/stable/authors-charm-building |
299 | 20 | # for more information on this pattern. | 26 | # for more information on this pattern. |
300 | 21 | from charms.reactive import main | 27 | from charms.reactive import main |
301 | 22 | main() | 28 | main() |
302 | 23 | 29 | ||
303 | === modified file 'hooks/website-relation-broken' | |||
304 | --- hooks/website-relation-broken 2016-01-12 22:40:14 +0000 | |||
305 | +++ hooks/website-relation-broken 2016-02-29 23:22:49 +0000 | |||
306 | @@ -4,15 +4,16 @@ | |||
307 | 4 | import sys | 4 | import sys |
308 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
309 | 6 | 6 | ||
312 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
313 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
314 | 9 | basic.init_config_states() | ||
315 | 9 | 10 | ||
316 | 10 | 11 | ||
317 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
318 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
319 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
320 | 14 | # | 15 | # |
322 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
323 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
324 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
325 | 18 | main() | 19 | main() |
326 | 19 | 20 | ||
327 | === modified file 'hooks/website-relation-changed' | |||
328 | --- hooks/website-relation-changed 2016-01-12 22:40:14 +0000 | |||
329 | +++ hooks/website-relation-changed 2016-02-29 23:22:49 +0000 | |||
330 | @@ -4,15 +4,16 @@ | |||
331 | 4 | import sys | 4 | import sys |
332 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
333 | 6 | 6 | ||
336 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
337 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
338 | 9 | basic.init_config_states() | ||
339 | 9 | 10 | ||
340 | 10 | 11 | ||
341 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
342 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
343 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
344 | 14 | # | 15 | # |
346 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
347 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
348 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
349 | 18 | main() | 19 | main() |
350 | 19 | 20 | ||
351 | === modified file 'hooks/website-relation-departed' | |||
352 | --- hooks/website-relation-departed 2016-01-12 22:40:14 +0000 | |||
353 | +++ hooks/website-relation-departed 2016-02-29 23:22:49 +0000 | |||
354 | @@ -4,15 +4,16 @@ | |||
355 | 4 | import sys | 4 | import sys |
356 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
357 | 6 | 6 | ||
360 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
361 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
362 | 9 | basic.init_config_states() | ||
363 | 9 | 10 | ||
364 | 10 | 11 | ||
365 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
366 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
367 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
368 | 14 | # | 15 | # |
370 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
371 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
372 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
373 | 18 | main() | 19 | main() |
374 | 19 | 20 | ||
375 | === modified file 'hooks/website-relation-joined' | |||
376 | --- hooks/website-relation-joined 2016-01-12 22:40:14 +0000 | |||
377 | +++ hooks/website-relation-joined 2016-02-29 23:22:49 +0000 | |||
378 | @@ -4,15 +4,16 @@ | |||
379 | 4 | import sys | 4 | import sys |
380 | 5 | sys.path.append('lib') | 5 | sys.path.append('lib') |
381 | 6 | 6 | ||
384 | 7 | from charms.bootstrap import bootstrap_charm_deps | 7 | from charms.layer import basic |
385 | 8 | bootstrap_charm_deps() | 8 | basic.bootstrap_charm_deps() |
386 | 9 | basic.init_config_states() | ||
387 | 9 | 10 | ||
388 | 10 | 11 | ||
389 | 11 | # This will load and run the appropriate @hook and other decorated | 12 | # This will load and run the appropriate @hook and other decorated |
390 | 12 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, | 13 | # handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive, |
391 | 13 | # and $CHARM_DIR/hooks/relations. | 14 | # and $CHARM_DIR/hooks/relations. |
392 | 14 | # | 15 | # |
394 | 15 | # See https://jujucharms.com/docs/stable/getting-started-with-charms-reactive | 16 | # See https://jujucharms.com/docs/stable/authors-charm-building |
395 | 16 | # for more information on this pattern. | 17 | # for more information on this pattern. |
396 | 17 | from charms.reactive import main | 18 | from charms.reactive import main |
397 | 18 | main() | 19 | main() |
398 | 19 | 20 | ||
399 | === modified file 'layer.yaml' | |||
400 | --- layer.yaml 2016-01-12 22:40:14 +0000 | |||
401 | +++ layer.yaml 2016-02-29 23:22:49 +0000 | |||
402 | @@ -11,6 +11,8 @@ | |||
403 | 11 | - gcc | 11 | - gcc |
404 | 12 | - supervisor | 12 | - supervisor |
405 | 13 | - git | 13 | - git |
406 | 14 | use_venv: false | ||
407 | 15 | include_system_packages: false | ||
408 | 14 | nginx: {} | 16 | nginx: {} |
409 | 15 | fiche: {} | 17 | fiche: {} |
410 | 16 | is: fiche | 18 | is: fiche |
411 | 17 | 19 | ||
412 | === added directory 'lib/charms/layer' | |||
413 | === added file 'lib/charms/layer/__init__.py' | |||
414 | --- lib/charms/layer/__init__.py 1970-01-01 00:00:00 +0000 | |||
415 | +++ lib/charms/layer/__init__.py 2016-02-29 23:22:49 +0000 | |||
416 | @@ -0,0 +1,21 @@ | |||
417 | 1 | import os | ||
418 | 2 | |||
419 | 3 | |||
420 | 4 | class LayerOptions(dict): | ||
421 | 5 | def __init__(self, layer_file, section=None): | ||
422 | 6 | import yaml # defer, might not be available until bootstrap | ||
423 | 7 | with open(layer_file) as f: | ||
424 | 8 | layer = yaml.safe_load(f.read()) | ||
425 | 9 | opts = layer.get('options', {}) | ||
426 | 10 | if section and section in opts: | ||
427 | 11 | super(LayerOptions, self).__init__(opts.get(section)) | ||
428 | 12 | else: | ||
429 | 13 | super(LayerOptions, self).__init__(opts) | ||
430 | 14 | |||
431 | 15 | |||
432 | 16 | def options(section=None, layer_file=None): | ||
433 | 17 | if not layer_file: | ||
434 | 18 | base_dir = os.environ.get('CHARM_DIR', os.getcwd()) | ||
435 | 19 | layer_file = os.path.join(base_dir, 'layer.yaml') | ||
436 | 20 | |||
437 | 21 | return LayerOptions(layer_file, section) | ||
438 | 0 | 22 | ||
439 | === added file 'lib/charms/layer/basic.py' | |||
440 | --- lib/charms/layer/basic.py 1970-01-01 00:00:00 +0000 | |||
441 | +++ lib/charms/layer/basic.py 2016-02-29 23:22:49 +0000 | |||
442 | @@ -0,0 +1,114 @@ | |||
443 | 1 | import os | ||
444 | 2 | import sys | ||
445 | 3 | import shutil | ||
446 | 4 | from glob import glob | ||
447 | 5 | from subprocess import check_call | ||
448 | 6 | |||
449 | 7 | |||
450 | 8 | def bootstrap_charm_deps(): | ||
451 | 9 | """ | ||
452 | 10 | Set up the base charm dependencies so that the reactive system can run. | ||
453 | 11 | """ | ||
454 | 12 | venv = os.path.abspath('../.venv') | ||
455 | 13 | vbin = os.path.join(venv, 'bin') | ||
456 | 14 | vpip = os.path.join(vbin, 'pip') | ||
457 | 15 | vpy = os.path.join(vbin, 'python') | ||
458 | 16 | if os.path.exists('wheelhouse/.bootstrapped'): | ||
459 | 17 | from charms import layer | ||
460 | 18 | cfg = layer.options('basic') | ||
461 | 19 | if cfg.get('use_venv') and '.venv' not in sys.executable: | ||
462 | 20 | # activate the venv | ||
463 | 21 | os.environ['PATH'] = ':'.join([vbin, os.environ['PATH']]) | ||
464 | 22 | reload_interpreter(vpy) | ||
465 | 23 | return | ||
466 | 24 | # bootstrap wheelhouse | ||
467 | 25 | if os.path.exists('wheelhouse'): | ||
468 | 26 | apt_install(['python3-pip', 'python3-yaml']) | ||
469 | 27 | from charms import layer | ||
470 | 28 | cfg = layer.options('basic') | ||
471 | 29 | # include packages defined in layer.yaml | ||
472 | 30 | apt_install(cfg.get('packages', [])) | ||
473 | 31 | # if we're using a venv, set it up | ||
474 | 32 | if cfg.get('use_venv'): | ||
475 | 33 | if not os.path.exists(venv): | ||
476 | 34 | apt_install(['python-virtualenv']) | ||
477 | 35 | cmd = ['virtualenv', '--python=python3', venv] | ||
478 | 36 | if cfg.get('include_system_packages'): | ||
479 | 37 | cmd.append('--system-site-packages') | ||
480 | 38 | check_call(cmd) | ||
481 | 39 | os.environ['PATH'] = ':'.join([vbin, os.environ['PATH']]) | ||
482 | 40 | pip = vpip | ||
483 | 41 | else: | ||
484 | 42 | pip = 'pip3' | ||
485 | 43 | # save a copy of system pip to prevent `pip3 install -U pip` from changing it | ||
486 | 44 | if os.path.exists('/usr/bin/pip'): | ||
487 | 45 | shutil.copy2('/usr/bin/pip', '/usr/bin/pip.save') | ||
488 | 46 | # need newer pip, to fix spurious Double Requirement error https://github.com/pypa/pip/issues/56 | ||
489 | 47 | check_call([pip, 'install', '-U', '--no-index', '-f', 'wheelhouse', 'pip']) | ||
490 | 48 | # install the rest of the wheelhouse deps | ||
491 | 49 | check_call([pip, 'install', '-U', '--no-index', '-f', 'wheelhouse'] + glob('wheelhouse/*')) | ||
492 | 50 | if not cfg.get('use_venv'): | ||
493 | 51 | # restore system pip to prevent `pip3 install -U pip` from changing it | ||
494 | 52 | if os.path.exists('/usr/bin/pip.save'): | ||
495 | 53 | shutil.copy2('/usr/bin/pip.save', '/usr/bin/pip') | ||
496 | 54 | os.remove('/usr/bin/pip.save') | ||
497 | 55 | # flag us as having already bootstrapped so we don't do it again | ||
498 | 56 | open('wheelhouse/.bootstrapped', 'w').close() | ||
499 | 57 | # Ensure that the newly bootstrapped libs are available. | ||
500 | 58 | # Note: this only seems to be an issue with namespace packages. | ||
501 | 59 | # Non-namespace-package libs (e.g., charmhelpers) are available | ||
502 | 60 | # without having to reload the interpreter. :/ | ||
503 | 61 | reload_interpreter(vpy if cfg.get('use_venv') else sys.argv[0]) | ||
504 | 62 | |||
505 | 63 | |||
506 | 64 | def reload_interpreter(python): | ||
507 | 65 | """ | ||
508 | 66 | Reload the python interpreter to ensure that all deps are available. | ||
509 | 67 | |||
510 | 68 | Newly installed modules in namespace packages sometimes seemt to | ||
511 | 69 | not be picked up by Python 3. | ||
512 | 70 | """ | ||
513 | 71 | os.execle(python, python, sys.argv[0], os.environ) | ||
514 | 72 | |||
515 | 73 | |||
516 | 74 | def apt_install(packages): | ||
517 | 75 | """ | ||
518 | 76 | Install apt packages. | ||
519 | 77 | |||
520 | 78 | This ensures a consistent set of options that are often missed but | ||
521 | 79 | should really be set. | ||
522 | 80 | """ | ||
523 | 81 | if isinstance(packages, (str, bytes)): | ||
524 | 82 | packages = [packages] | ||
525 | 83 | |||
526 | 84 | env = os.environ.copy() | ||
527 | 85 | |||
528 | 86 | if 'DEBIAN_FRONTEND' not in env: | ||
529 | 87 | env['DEBIAN_FRONTEND'] = 'noninteractive' | ||
530 | 88 | |||
531 | 89 | cmd = ['apt-get', | ||
532 | 90 | '--option=Dpkg::Options::=--force-confold', | ||
533 | 91 | '--assume-yes', | ||
534 | 92 | 'install'] | ||
535 | 93 | check_call(cmd + packages, env=env) | ||
536 | 94 | |||
537 | 95 | |||
538 | 96 | def init_config_states(): | ||
539 | 97 | from charmhelpers.core import hookenv | ||
540 | 98 | from charms.reactive import set_state | ||
541 | 99 | config = hookenv.config() | ||
542 | 100 | for opt in config.keys(): | ||
543 | 101 | if config.changed(opt): | ||
544 | 102 | set_state('config.changed') | ||
545 | 103 | set_state('config.changed.{}'.format(opt)) | ||
546 | 104 | hookenv.atexit(clear_config_states) | ||
547 | 105 | |||
548 | 106 | |||
549 | 107 | def clear_config_states(): | ||
550 | 108 | from charmhelpers.core import hookenv, unitdata | ||
551 | 109 | from charms.reactive import remove_state | ||
552 | 110 | config = hookenv.config() | ||
553 | 111 | remove_state('config.changed') | ||
554 | 112 | for opt in config.keys(): | ||
555 | 113 | remove_state('config.changed.{}'.format(opt)) | ||
556 | 114 | unitdata.kv().flush() | ||
557 | 0 | 115 | ||
558 | === modified file 'metadata.yaml' | |||
559 | --- metadata.yaml 2016-01-12 22:40:14 +0000 | |||
560 | +++ metadata.yaml 2016-02-29 23:22:49 +0000 | |||
561 | @@ -1,6 +1,6 @@ | |||
562 | 1 | name: fiche | 1 | name: fiche |
563 | 2 | summary: Fiche is an open source command line pastebin server. | 2 | summary: Fiche is an open source command line pastebin server. |
565 | 3 | maintainer: James Beedy <James.Beedy@os-deployer.darkhorseint.com> | 3 | maintainer: James Beedy <jamesbeedy@gmail.com> |
566 | 4 | description: | | 4 | description: | |
567 | 5 | Fiche is an open source command line pastebin server. It can be found here: | 5 | Fiche is an open source command line pastebin server. It can be found here: |
568 | 6 | https://github.com/solusipse/fiche | 6 | https://github.com/solusipse/fiche |
569 | 7 | 7 | ||
570 | === modified file 'reactive/fiche.py' | |||
571 | --- reactive/fiche.py 2016-01-12 22:40:14 +0000 | |||
572 | +++ reactive/fiche.py 2016-02-29 23:22:49 +0000 | |||
573 | @@ -1,5 +1,5 @@ | |||
576 | 1 | #!/usr/bin/python | 1 | #!/usr/bin/python3 |
577 | 2 | # Copyright (c) 2015, James Beedy <jamesbeedy@gmail.com> | 2 | # Copyright (c) 2016, James Beedy <jamesbeedy@gmail.com> |
578 | 3 | 3 | ||
579 | 4 | import os | 4 | import os |
580 | 5 | import sys | 5 | import sys |
581 | @@ -7,9 +7,10 @@ | |||
582 | 7 | import shutil | 7 | import shutil |
583 | 8 | import subprocess | 8 | import subprocess |
584 | 9 | 9 | ||
585 | 10 | from charms.reactive import hook | ||
586 | 11 | from charms.reactive import when | 10 | from charms.reactive import when |
587 | 11 | from charms.reactive import when_not | ||
588 | 12 | from charms.reactive import only_once | 12 | from charms.reactive import only_once |
589 | 13 | from charms.reactive import set_state | ||
590 | 13 | from charmhelpers.core.templating import render | 14 | from charmhelpers.core.templating import render |
591 | 14 | from charmhelpers.core import hookenv | 15 | from charmhelpers.core import hookenv |
592 | 15 | from charmhelpers.core import host | 16 | from charmhelpers.core import host |
593 | @@ -25,7 +26,7 @@ | |||
594 | 25 | config = hookenv.config() | 26 | config = hookenv.config() |
595 | 26 | 27 | ||
596 | 27 | FICHE_SUPERVISOR_CTXT = { | 28 | FICHE_SUPERVISOR_CTXT = { |
598 | 28 | 'fiche_server_address': hookenv.unit_get('private-address'), | 29 | 'fiche_server_address': hookenv.unit_public_ip(), |
599 | 29 | 'fiche_server_port': config['fiche-server-port'], | 30 | 'fiche_server_port': config['fiche-server-port'], |
600 | 30 | 'slug_size': config['slug-size'], | 31 | 'slug_size': config['slug-size'], |
601 | 31 | 'buffer_size': config['buffer-size'] | 32 | 'buffer_size': config['buffer-size'] |
602 | @@ -68,6 +69,7 @@ | |||
603 | 68 | 69 | ||
604 | 69 | 70 | ||
605 | 70 | @when('nginx.available') | 71 | @when('nginx.available') |
606 | 72 | @when_not('fiche.available') | ||
607 | 71 | @only_once | 73 | @only_once |
608 | 72 | def install_fiche(): | 74 | def install_fiche(): |
609 | 73 | 75 | ||
610 | @@ -76,9 +78,6 @@ | |||
611 | 76 | 78 | ||
612 | 77 | hookenv.status_set('maintenance', 'Installing and configuring Fiche.') | 79 | hookenv.status_set('maintenance', 'Installing and configuring Fiche.') |
613 | 78 | 80 | ||
614 | 79 | # Configure nginx vhost | ||
615 | 80 | configure_site('fiche', 'fiche.vhost', app_path=FICHE_CODE_DIR) | ||
616 | 81 | |||
617 | 82 | # Clone fiche repo | 81 | # Clone fiche repo |
618 | 83 | hookenv.status_set('maintenance', | 82 | hookenv.status_set('maintenance', |
619 | 84 | 'Installing and building fiche from github.') | 83 | 'Installing and building fiche from github.') |
620 | @@ -94,26 +93,70 @@ | |||
621 | 94 | # Ensure base dir exists | 93 | # Ensure base dir exists |
622 | 95 | _ensure_basedir() | 94 | _ensure_basedir() |
623 | 96 | 95 | ||
624 | 96 | # Configure nginx vhost | ||
625 | 97 | configure_site('fiche', 'fiche.vhost', app_path=FICHE_CODE_DIR) | ||
626 | 98 | |||
627 | 97 | # Render fiche supervisor conf | 99 | # Render fiche supervisor conf |
628 | 98 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) | 100 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) |
631 | 99 | hookenv.status_set('active', 'Fiche is active and ready!') | 101 | |
632 | 100 | 102 | # Open fiche server port | |
633 | 103 | hookenv.open_port(config['fiche-server-port']) | ||
634 | 104 | |||
635 | 105 | # Open fiche front-end port | ||
636 | 106 | hookenv.open_port(config['port']) | ||
637 | 107 | |||
638 | 108 | # Set status | ||
639 | 109 | hookenv.status_set('active', 'Fiche is active on port %s' % \ | ||
640 | 110 | config['fiche-server-port']) | ||
641 | 111 | # Set state | ||
642 | 112 | set_state('fiche.available') | ||
643 | 113 | |||
644 | 101 | 114 | ||
645 | 102 | @when('nginx.available', 'website.available') | 115 | @when('nginx.available', 'website.available') |
646 | 103 | def configure_website(website): | 116 | def configure_website(website): |
647 | 104 | website.configure(port=config['port']) | 117 | website.configure(port=config['port']) |
648 | 105 | 118 | ||
649 | 106 | 119 | ||
663 | 107 | @hook('config-changed') | 120 | @when('config.changed.fiche-server-port') |
664 | 108 | def fiche_config_changed(): | 121 | def fiche_port_changed(): |
665 | 109 | 122 | ||
666 | 110 | """ React to fiche config-changed | 123 | """ React to fiche-server-port changed |
667 | 111 | """ | 124 | """ |
668 | 112 | hookenv.status_set('maintenance', 'Reconfiguring fiche.') | 125 | hookenv.status_set('maintenance', 'Reconfiguring fiche-server-port') |
669 | 113 | 126 | ||
670 | 114 | if config.changed('fiche-server-port') or \ | 127 | # Check and change open port, close prev port |
671 | 115 | config.changed('slug-size') or \ | 128 | if config.previous('fiche-server-port') and \ |
672 | 116 | config.changed('buffer-size'): | 129 | config.previous('fiche-server-port') != config['fiche-server-port']: |
673 | 117 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) | 130 | hookenv.close_port(config.previous('fiche-server-port')) |
674 | 118 | 131 | hookenv.open_port(config['fiche-server-port']) | |
675 | 119 | hookenv.status_set('active', 'Fiche is active and ready!') | 132 | |
676 | 133 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) | ||
677 | 134 | hookenv.status_set('active', 'Fiche is active on port %s' % \ | ||
678 | 135 | config['fiche-server-port']) | ||
679 | 136 | |||
680 | 137 | |||
681 | 138 | @when('config.changed.slug-size') | ||
682 | 139 | def fiche_slug_size_changed(): | ||
683 | 140 | |||
684 | 141 | """ React to slug-size changed | ||
685 | 142 | """ | ||
686 | 143 | hookenv.status_set('maintenance', 'Reconfiguring slug-size') | ||
687 | 144 | |||
688 | 145 | # Rerender supervisord conf | ||
689 | 146 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) | ||
690 | 147 | |||
691 | 148 | hookenv.status_set('active', 'Fiche is active on port %s' % \ | ||
692 | 149 | config['fiche-server-port']) | ||
693 | 150 | |||
694 | 151 | @when('config.changed.buffer-size') | ||
695 | 152 | def fiche_buffer_size_changed(): | ||
696 | 153 | |||
697 | 154 | """ React to buffer-size changed | ||
698 | 155 | """ | ||
699 | 156 | hookenv.status_set('maintenance', 'Reconfiguring buffer-size') | ||
700 | 157 | |||
701 | 158 | # Rerender supervisord conf | ||
702 | 159 | _render_fiche_supervisor_conf(FICHE_SUPERVISOR_CTXT) | ||
703 | 160 | |||
704 | 161 | hookenv.status_set('active', 'Fiche is active on port %s' % \ | ||
705 | 162 | config['fiche-server-port']) | ||
706 | 120 | 163 | ||
707 | === modified file 'tests/10-deploy' | |||
708 | --- tests/10-deploy 2016-01-12 22:40:14 +0000 | |||
709 | +++ tests/10-deploy 2016-02-29 23:22:49 +0000 | |||
710 | @@ -4,13 +4,30 @@ | |||
711 | 4 | import requests | 4 | import requests |
712 | 5 | import unittest | 5 | import unittest |
713 | 6 | 6 | ||
714 | 7 | import socket | ||
715 | 8 | |||
716 | 9 | |||
717 | 10 | def netcat(host, port, content): | ||
718 | 11 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
719 | 12 | s.connect((host, int(port))) | ||
720 | 13 | s.sendall(content.encode()) | ||
721 | 14 | s.shutdown(socket.SHUT_WR) | ||
722 | 15 | while True: | ||
723 | 16 | data = s.recv(4096) | ||
724 | 17 | if not data: | ||
725 | 18 | break | ||
726 | 19 | dat = data | ||
727 | 20 | s.close() | ||
728 | 21 | return dat | ||
729 | 22 | |||
730 | 7 | 23 | ||
731 | 8 | class TestDeployment(unittest.TestCase): | 24 | class TestDeployment(unittest.TestCase): |
732 | 9 | @classmethod | 25 | @classmethod |
733 | 10 | def setUpClass(cls): | 26 | def setUpClass(cls): |
735 | 11 | cls.deployment = amulet.Deployment() | 27 | cls.deployment = amulet.Deployment(series='trusty') |
736 | 12 | 28 | ||
737 | 13 | cls.deployment.add('fiche') | 29 | cls.deployment.add('fiche') |
738 | 30 | cls.deployment.configure('fiche', {'fiche-server-port': 9999}) | ||
739 | 14 | cls.deployment.expose('fiche') | 31 | cls.deployment.expose('fiche') |
740 | 15 | 32 | ||
741 | 16 | try: | 33 | try: |
742 | @@ -20,32 +37,14 @@ | |||
743 | 20 | amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time") | 37 | amulet.raise_status(amulet.SKIP, msg="Environment wasn't stood up in time") |
744 | 21 | except: | 38 | except: |
745 | 22 | raise | 39 | raise |
772 | 23 | cls.unit = cls.deployment.sentry.unit['fiche/0'] | 40 | cls.unit = cls.deployment.sentry.unit['fiche'][1] |
773 | 24 | 41 | cls.ipaddr = cls.unit.info['public-address'] | |
774 | 25 | def test_case(self): | 42 | cls.base_url = 'http://%s/' % cls.ipaddr |
775 | 26 | # Now you can use self.deployment.sentry.unit[UNIT] to address each of | 43 | |
776 | 27 | # the units and perform more in-depth steps. You can also reference | 44 | |
777 | 28 | # the first unit as self.unit. | 45 | def test_1_verify_base_url(self): |
778 | 29 | # There are three test statuses that can be triggered with | 46 | response = requests.get(self.base_url) |
779 | 30 | # amulet.raise_status(): | 47 | response.raise_for_status() |
754 | 31 | # - amulet.PASS | ||
755 | 32 | # - amulet.FAIL | ||
756 | 33 | # - amulet.SKIP | ||
757 | 34 | # Each unit has the following methods: | ||
758 | 35 | # - .info - An array of the information of that unit from Juju | ||
759 | 36 | # - .file(PATH) - Get the details of a file on that unit | ||
760 | 37 | # - .file_contents(PATH) - Get plain text output of PATH file from that unit | ||
761 | 38 | # - .directory(PATH) - Get details of directory | ||
762 | 39 | # - .directory_contents(PATH) - List files and folders in PATH on that unit | ||
763 | 40 | # - .relation(relation, service:rel) - Get relation data from return service | ||
764 | 41 | # add tests here to confirm service is up and working properly | ||
765 | 42 | # For example, to confirm that it has a functioning HTTP server: | ||
766 | 43 | # page = requests.get('http://{}'.format(self.unit.info['public-address'])) | ||
767 | 44 | # page.raise_for_status() | ||
768 | 45 | # More information on writing Amulet tests can be found at: | ||
769 | 46 | # https://jujucharms.com/docs/stable/tools-amulet | ||
770 | 47 | pass | ||
771 | 48 | |||
780 | 49 | 48 | ||
781 | 50 | if __name__ == '__main__': | 49 | if __name__ == '__main__': |
782 | 51 | unittest.main() | 50 | unittest.main() |
783 | 52 | 51 | ||
784 | === removed directory 'unit_tests' | |||
785 | === removed file 'unit_tests/test_actions.py' | |||
786 | --- unit_tests/test_actions.py 2016-01-12 22:40:14 +0000 | |||
787 | +++ unit_tests/test_actions.py 1970-01-01 00:00:00 +0000 | |||
788 | @@ -1,21 +0,0 @@ | |||
789 | 1 | #!/usr/bin/env python | ||
790 | 2 | |||
791 | 3 | import sys | ||
792 | 4 | import mock | ||
793 | 5 | import unittest | ||
794 | 6 | from pkg_resources import resource_filename | ||
795 | 7 | |||
796 | 8 | # allow importing actions from the hooks directory | ||
797 | 9 | sys.path.append(resource_filename(__name__, '../hooks')) | ||
798 | 10 | import actions | ||
799 | 11 | |||
800 | 12 | |||
801 | 13 | class TestActions(unittest.TestCase): | ||
802 | 14 | @mock.patch('charmhelpers.core.hookenv.log') | ||
803 | 15 | def test_log_start(self, log): | ||
804 | 16 | actions.log_start('test-service') | ||
805 | 17 | log.assert_called_once_with('fiche starting') | ||
806 | 18 | |||
807 | 19 | |||
808 | 20 | if __name__ == '__main__': | ||
809 | 21 | unittest.main() | ||
810 | 22 | 0 | ||
811 | === removed file 'wheelhouse/charmhelpers-0.6.1.tar.gz' | |||
812 | 23 | Binary files wheelhouse/charmhelpers-0.6.1.tar.gz 2016-01-12 22:40:14 +0000 and wheelhouse/charmhelpers-0.6.1.tar.gz 1970-01-01 00:00:00 +0000 differ | 1 | Binary files wheelhouse/charmhelpers-0.6.1.tar.gz 2016-01-12 22:40:14 +0000 and wheelhouse/charmhelpers-0.6.1.tar.gz 1970-01-01 00:00:00 +0000 differ |
813 | === added file 'wheelhouse/charmhelpers-0.6.2.tar.gz' | |||
814 | 24 | Binary files wheelhouse/charmhelpers-0.6.2.tar.gz 1970-01-01 00:00:00 +0000 and wheelhouse/charmhelpers-0.6.2.tar.gz 2016-02-29 23:22:49 +0000 differ | 2 | Binary files wheelhouse/charmhelpers-0.6.2.tar.gz 1970-01-01 00:00:00 +0000 and wheelhouse/charmhelpers-0.6.2.tar.gz 2016-02-29 23:22:49 +0000 differ |
815 | === removed file 'wheelhouse/charms.reactive-0.3.7.tar.gz' | |||
816 | 25 | Binary files wheelhouse/charms.reactive-0.3.7.tar.gz 2016-01-12 22:40:14 +0000 and wheelhouse/charms.reactive-0.3.7.tar.gz 1970-01-01 00:00:00 +0000 differ | 3 | Binary files wheelhouse/charms.reactive-0.3.7.tar.gz 2016-01-12 22:40:14 +0000 and wheelhouse/charms.reactive-0.3.7.tar.gz 1970-01-01 00:00:00 +0000 differ |
817 | === added file 'wheelhouse/charms.reactive-0.3.8.tar.gz' | |||
818 | 26 | Binary files wheelhouse/charms.reactive-0.3.8.tar.gz 1970-01-01 00:00:00 +0000 and wheelhouse/charms.reactive-0.3.8.tar.gz 2016-02-29 23:22:49 +0000 differ | 4 | Binary files wheelhouse/charms.reactive-0.3.8.tar.gz 1970-01-01 00:00:00 +0000 and wheelhouse/charms.reactive-0.3.8.tar.gz 2016-02-29 23:22:49 +0000 differ |