Merge lp:~smoser/eucalyptus/euca2ools-1.0.fixes into lp:eucalyptus/euca2ools-1.0
- euca2ools-1.0.fixes
- Merge into euca2ools-1.0
Proposed by
Scott Moser
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~smoser/eucalyptus/euca2ools-1.0.fixes |
Merge into: | lp:eucalyptus/euca2ools-1.0 |
Diff against target: |
1182 lines (+160/-154) 43 files modified
bin/euca-add-group (+3/-3) bin/euca-add-keypair (+3/-3) bin/euca-allocate-address (+3/-3) bin/euca-associate-address (+3/-3) bin/euca-attach-volume (+3/-3) bin/euca-authorize (+4/-2) bin/euca-bundle-image (+3/-3) bin/euca-bundle-vol (+3/-3) bin/euca-confirm-product-instance (+3/-3) bin/euca-create-snapshot (+3/-3) bin/euca-create-volume (+3/-2) bin/euca-delete-bundle (+3/-3) bin/euca-delete-group (+3/-3) bin/euca-delete-keypair (+3/-3) bin/euca-delete-snapshot (+3/-3) bin/euca-delete-volume (+3/-3) bin/euca-deregister (+3/-3) bin/euca-describe-addresses (+3/-3) bin/euca-describe-availability-zones (+3/-3) bin/euca-describe-groups (+3/-3) bin/euca-describe-image-attribute (+3/-3) bin/euca-describe-images (+3/-2) bin/euca-describe-instances (+3/-3) bin/euca-describe-keypairs (+3/-3) bin/euca-describe-regions (+3/-3) bin/euca-describe-snapshots (+3/-3) bin/euca-describe-volumes (+3/-3) bin/euca-detach-volume (+3/-3) bin/euca-disassociate-address (+3/-3) bin/euca-download-bundle (+3/-3) bin/euca-get-console-output (+3/-3) bin/euca-modify-image-attribute (+3/-3) bin/euca-reboot-instances (+3/-3) bin/euca-register (+3/-3) bin/euca-release-address (+3/-3) bin/euca-reset-image-attribute (+3/-3) bin/euca-revoke (+3/-3) bin/euca-run-instances (+3/-3) bin/euca-terminate-instances (+3/-3) bin/euca-unbundle (+3/-3) bin/euca-upload-bundle (+3/-3) bin/euca-version (+3/-3) euca2ools/euca2ools/__init__.py (+33/-31) |
To merge this branch: | bzr merge lp:~smoser/eucalyptus/euca2ools-1.0.fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eucalyptus Maintainers | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message

Scott Moser (smoser) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/euca-add-group' |
2 | --- bin/euca-add-group 2010-02-21 03:44:16 +0000 |
3 | +++ bin/euca-add-group 2010-02-26 15:47:11 +0000 |
4 | @@ -50,10 +50,10 @@ |
5 | """ |
6 | |
7 | |
8 | -def usage(): |
9 | +def usage(status=1): |
10 | print usage_string |
11 | Util().usage() |
12 | - sys.exit() |
13 | + sys.exit(status) |
14 | |
15 | def version(): |
16 | print Util().version() |
17 | @@ -78,7 +78,7 @@ |
18 | if name in ('-d', '--description'): |
19 | group_description = value |
20 | elif name in ('-h', '--help'): |
21 | - usage() |
22 | + usage(0) |
23 | elif name == '--version': |
24 | version() |
25 | |
26 | |
27 | === modified file 'bin/euca-add-keypair' |
28 | --- bin/euca-add-keypair 2010-02-21 03:44:16 +0000 |
29 | +++ bin/euca-add-keypair 2010-02-26 15:47:11 +0000 |
30 | @@ -49,10 +49,10 @@ |
31 | """ |
32 | |
33 | |
34 | -def usage(): |
35 | +def usage(status=1): |
36 | print usage_string |
37 | Util().usage() |
38 | - sys.exit() |
39 | + sys.exit(status) |
40 | |
41 | def version(): |
42 | print Util().version() |
43 | @@ -76,7 +76,7 @@ |
44 | |
45 | for name, value in euca.opts: |
46 | if name in ('-h', '--help'): |
47 | - usage() |
48 | + usage(0) |
49 | elif name == '--version': |
50 | version() |
51 | |
52 | |
53 | === modified file 'bin/euca-allocate-address' |
54 | --- bin/euca-allocate-address 2010-02-21 03:44:16 +0000 |
55 | +++ bin/euca-allocate-address 2010-02-26 15:47:11 +0000 |
56 | @@ -45,10 +45,10 @@ |
57 | """ |
58 | |
59 | |
60 | -def usage(): |
61 | +def usage(status=1): |
62 | print usage_string |
63 | Util().usage() |
64 | - sys.exit() |
65 | + sys.exit(status) |
66 | |
67 | def version(): |
68 | print Util().version() |
69 | @@ -64,7 +64,7 @@ |
70 | |
71 | for name, value in euca.opts: |
72 | if name in ('-h', '--help'): |
73 | - usage() |
74 | + usage(0) |
75 | elif name == '--version': |
76 | version() |
77 | |
78 | |
79 | === modified file 'bin/euca-associate-address' |
80 | --- bin/euca-associate-address 2010-02-21 03:44:16 +0000 |
81 | +++ bin/euca-associate-address 2010-02-26 15:47:11 +0000 |
82 | @@ -52,10 +52,10 @@ |
83 | """ |
84 | |
85 | |
86 | -def usage(): |
87 | +def usage(status=1): |
88 | print usage_string |
89 | Util().usage() |
90 | - sys.exit() |
91 | + sys.exit(status) |
92 | |
93 | def version(): |
94 | print Util().version() |
95 | @@ -76,7 +76,7 @@ |
96 | if name in ('-i', '--instance'): |
97 | instance_id = value |
98 | elif name in ('-h', '--help'): |
99 | - usage() |
100 | + usage(0) |
101 | elif name == '--version': |
102 | version() |
103 | |
104 | |
105 | === modified file 'bin/euca-attach-volume' |
106 | --- bin/euca-attach-volume 2010-02-21 03:44:16 +0000 |
107 | +++ bin/euca-attach-volume 2010-02-26 15:47:11 +0000 |
108 | @@ -54,10 +54,10 @@ |
109 | """ |
110 | |
111 | |
112 | -def usage(): |
113 | +def usage(status=1): |
114 | print usage_string |
115 | Util().usage() |
116 | - sys.exit() |
117 | + sys.exit(status) |
118 | |
119 | def version(): |
120 | print Util().version() |
121 | @@ -82,7 +82,7 @@ |
122 | elif name in ('-d', '--device'): |
123 | device = value |
124 | elif name in ('-h', '--help'): |
125 | - usage() |
126 | + usage(0) |
127 | elif name == '--version': |
128 | version() |
129 | |
130 | |
131 | === modified file 'bin/euca-authorize' |
132 | --- bin/euca-authorize 2010-02-16 20:46:57 +0000 |
133 | +++ bin/euca-authorize 2010-02-26 15:47:11 +0000 |
134 | @@ -64,9 +64,11 @@ |
135 | """ |
136 | |
137 | |
138 | -def usage(): |
139 | +def usage(status=1): |
140 | print usage_string |
141 | Util().usage(compat=True) |
142 | + sys.exit(status) |
143 | + |
144 | |
145 | def version(): |
146 | print Util().version() |
147 | @@ -116,7 +118,7 @@ |
148 | print "port must be an integer." |
149 | sys.exit(1) |
150 | elif name in ('-h', '--help'): |
151 | - usage() |
152 | + usage(0) |
153 | elif name == '--version': |
154 | version() |
155 | |
156 | |
157 | === modified file 'bin/euca-bundle-image' |
158 | --- bin/euca-bundle-image 2010-02-21 03:44:16 +0000 |
159 | +++ bin/euca-bundle-image 2010-02-26 15:47:11 +0000 |
160 | @@ -74,10 +74,10 @@ |
161 | """ |
162 | |
163 | |
164 | -def usage(): |
165 | +def usage(status=1): |
166 | print usage_string |
167 | Util().usage() |
168 | - sys.exit() |
169 | + sys.exit(status) |
170 | |
171 | def version(): |
172 | print Util().version() |
173 | @@ -142,7 +142,7 @@ |
174 | |
175 | for name, value in euca.opts: |
176 | if name in ('-h', '--help'): |
177 | - usage() |
178 | + usage(0) |
179 | elif name in ('-i', '--image'): |
180 | image_path = value |
181 | elif name in ('-c', '--cert'): |
182 | |
183 | === modified file 'bin/euca-bundle-vol' |
184 | --- bin/euca-bundle-vol 2010-02-21 03:44:16 +0000 |
185 | +++ bin/euca-bundle-vol 2010-02-26 15:47:11 +0000 |
186 | @@ -89,9 +89,9 @@ |
187 | MAX_IMAGE_SIZE = 1024 * 10 |
188 | |
189 | |
190 | -def usage(): |
191 | +def usage(status=1): |
192 | print usage_string |
193 | - sys.exit() |
194 | + sys.exit(status) |
195 | |
196 | def version(): |
197 | print Util().version() |
198 | @@ -218,7 +218,7 @@ |
199 | |
200 | for name, value in euca.opts: |
201 | if name in ('-h', '--help'): |
202 | - usage() |
203 | + usage(0) |
204 | elif name in ('-c', '--cert'): |
205 | cert_path = value |
206 | elif name in ('-k', '--privatekey'): |
207 | |
208 | === modified file 'bin/euca-confirm-product-instance' |
209 | --- bin/euca-confirm-product-instance 2010-02-21 03:44:16 +0000 |
210 | +++ bin/euca-confirm-product-instance 2010-02-26 15:47:11 +0000 |
211 | @@ -51,10 +51,10 @@ |
212 | """ |
213 | |
214 | |
215 | -def usage(): |
216 | +def usage(status=1): |
217 | print usage_string |
218 | Util().usage() |
219 | - sys.exit() |
220 | + sys.exit(status) |
221 | |
222 | def version(): |
223 | print Util().version() |
224 | @@ -76,7 +76,7 @@ |
225 | if name in ('-i', '--instance'): |
226 | instance_id = value |
227 | elif name in ('-h', '--help'): |
228 | - usage() |
229 | + usage(0) |
230 | elif name == '--version': |
231 | version() |
232 | |
233 | |
234 | === modified file 'bin/euca-create-snapshot' |
235 | --- bin/euca-create-snapshot 2010-02-21 03:44:16 +0000 |
236 | +++ bin/euca-create-snapshot 2010-02-26 15:47:11 +0000 |
237 | @@ -49,10 +49,10 @@ |
238 | """ |
239 | |
240 | |
241 | -def usage(): |
242 | +def usage(status=1): |
243 | print usage_string |
244 | Util().usage() |
245 | - sys.exit() |
246 | + sys.exit(status) |
247 | |
248 | def version(): |
249 | print Util().version() |
250 | @@ -76,7 +76,7 @@ |
251 | |
252 | for name, value in euca.opts: |
253 | if name in ('-h', '--help'): |
254 | - usage() |
255 | + usage(0) |
256 | elif name == '--version': |
257 | version() |
258 | |
259 | |
260 | === modified file 'bin/euca-create-volume' |
261 | --- bin/euca-create-volume 2010-02-16 20:46:57 +0000 |
262 | +++ bin/euca-create-volume 2010-02-26 15:47:11 +0000 |
263 | @@ -54,9 +54,10 @@ |
264 | """ |
265 | |
266 | |
267 | -def usage(): |
268 | +def usage(status=1): |
269 | print usage_string |
270 | Util().usage(compat=True) |
271 | + sys.exit(status) |
272 | |
273 | def version(): |
274 | print Util().version() |
275 | @@ -98,7 +99,7 @@ |
276 | elif name == '--snapshot': |
277 | snapshot_id = value |
278 | elif name in ('-h', '--help'): |
279 | - usage() |
280 | + usage(0) |
281 | elif name == '--version': |
282 | version() |
283 | |
284 | |
285 | === modified file 'bin/euca-delete-bundle' |
286 | --- bin/euca-delete-bundle 2010-02-21 03:44:16 +0000 |
287 | +++ bin/euca-delete-bundle 2010-02-26 15:47:11 +0000 |
288 | @@ -66,10 +66,10 @@ |
289 | """ |
290 | |
291 | |
292 | -def usage(): |
293 | +def usage(status=1): |
294 | print usage_string |
295 | Util().usage() |
296 | - sys.exit() |
297 | + sys.exit(status) |
298 | |
299 | def version(): |
300 | print Util().version() |
301 | @@ -197,7 +197,7 @@ |
302 | |
303 | for name, value in euca.opts: |
304 | if name in ('-h', '--help'): |
305 | - usage() |
306 | + usage(0) |
307 | elif name in ('-b', '--bucket'): |
308 | bucket = value |
309 | elif name in ('-m', '--manifest'): |
310 | |
311 | === modified file 'bin/euca-delete-group' |
312 | --- bin/euca-delete-group 2010-02-21 03:44:16 +0000 |
313 | +++ bin/euca-delete-group 2010-02-26 15:47:11 +0000 |
314 | @@ -49,10 +49,10 @@ |
315 | """ |
316 | |
317 | |
318 | -def usage(): |
319 | +def usage(status=1): |
320 | print usage_string |
321 | Util().usage() |
322 | - sys.exit() |
323 | + sys.exit(status) |
324 | |
325 | def version(): |
326 | print Util().version() |
327 | @@ -70,7 +70,7 @@ |
328 | |
329 | for name, value in euca.opts: |
330 | if name in ('-h', '--help'): |
331 | - usage() |
332 | + usage(0) |
333 | elif name == '--version': |
334 | version() |
335 | |
336 | |
337 | === modified file 'bin/euca-delete-keypair' |
338 | --- bin/euca-delete-keypair 2010-02-21 03:44:16 +0000 |
339 | +++ bin/euca-delete-keypair 2010-02-26 15:47:11 +0000 |
340 | @@ -49,10 +49,10 @@ |
341 | """ |
342 | |
343 | |
344 | -def usage(): |
345 | +def usage(status=1): |
346 | print usage_string |
347 | Util().usage() |
348 | - sys.exit() |
349 | + sys.exit(status) |
350 | |
351 | def version(): |
352 | print Util().version() |
353 | @@ -74,7 +74,7 @@ |
354 | |
355 | for name, value in euca.opts: |
356 | if name in ('-h', '--help'): |
357 | - usage() |
358 | + usage(0) |
359 | elif name == '--version': |
360 | version() |
361 | |
362 | |
363 | === modified file 'bin/euca-delete-snapshot' |
364 | --- bin/euca-delete-snapshot 2010-02-21 03:44:16 +0000 |
365 | +++ bin/euca-delete-snapshot 2010-02-26 15:47:11 +0000 |
366 | @@ -49,10 +49,10 @@ |
367 | """ |
368 | |
369 | |
370 | -def usage(): |
371 | +def usage(status=1): |
372 | print usage_string |
373 | Util().usage() |
374 | - sys.exit() |
375 | + sys.exit(status) |
376 | |
377 | def version(): |
378 | print Util().version() |
379 | @@ -70,7 +70,7 @@ |
380 | |
381 | for name, value in euca.opts: |
382 | if name in ('-h', '--help'): |
383 | - usage() |
384 | + usage(0) |
385 | elif name == '--version': |
386 | version() |
387 | |
388 | |
389 | === modified file 'bin/euca-delete-volume' |
390 | --- bin/euca-delete-volume 2010-02-21 03:44:16 +0000 |
391 | +++ bin/euca-delete-volume 2010-02-26 15:47:11 +0000 |
392 | @@ -49,10 +49,10 @@ |
393 | """ |
394 | |
395 | |
396 | -def usage(): |
397 | +def usage(status=1): |
398 | print usage_string |
399 | Util().usage() |
400 | - sys.exit() |
401 | + sys.exit(status) |
402 | |
403 | def version(): |
404 | print Util().version() |
405 | @@ -71,7 +71,7 @@ |
406 | |
407 | for name, value in euca.opts: |
408 | if name in ('-h', '--help'): |
409 | - usage() |
410 | + usage(0) |
411 | elif name == '--version': |
412 | version() |
413 | |
414 | |
415 | === modified file 'bin/euca-deregister' |
416 | --- bin/euca-deregister 2010-02-21 03:44:16 +0000 |
417 | +++ bin/euca-deregister 2010-02-26 15:47:11 +0000 |
418 | @@ -49,10 +49,10 @@ |
419 | """ |
420 | |
421 | |
422 | -def usage(): |
423 | +def usage(status=1): |
424 | print usage_string |
425 | Util().usage() |
426 | - sys.exit() |
427 | + sys.exit(status) |
428 | |
429 | def version(): |
430 | print Util().version() |
431 | @@ -69,7 +69,7 @@ |
432 | |
433 | for name, value in euca.opts: |
434 | if name in ('-h', '--help'): |
435 | - usage() |
436 | + usage(0) |
437 | elif name == '--version': |
438 | version() |
439 | elif name == '--debug': |
440 | |
441 | === modified file 'bin/euca-describe-addresses' |
442 | --- bin/euca-describe-addresses 2010-02-21 03:44:16 +0000 |
443 | +++ bin/euca-describe-addresses 2010-02-26 15:47:11 +0000 |
444 | @@ -47,10 +47,10 @@ |
445 | """ |
446 | |
447 | |
448 | -def usage(): |
449 | +def usage(status=1): |
450 | print usage_string |
451 | Util().usage() |
452 | - sys.exit() |
453 | + sys.exit(status) |
454 | |
455 | def version(): |
456 | print Util().version() |
457 | @@ -77,7 +77,7 @@ |
458 | |
459 | for name, value in euca.opts: |
460 | if name in ('-h', '--help'): |
461 | - usage() |
462 | + usage(0) |
463 | elif name == '--version': |
464 | version() |
465 | |
466 | |
467 | === modified file 'bin/euca-describe-availability-zones' |
468 | --- bin/euca-describe-availability-zones 2010-02-21 03:44:16 +0000 |
469 | +++ bin/euca-describe-availability-zones 2010-02-26 15:47:11 +0000 |
470 | @@ -49,10 +49,10 @@ |
471 | """ |
472 | |
473 | |
474 | -def usage(): |
475 | +def usage(status=1): |
476 | print usage_string |
477 | Util().usage() |
478 | - sys.exit() |
479 | + sys.exit(status) |
480 | |
481 | def version(): |
482 | print Util().version() |
483 | @@ -77,7 +77,7 @@ |
484 | if name == '--region': |
485 | region = value |
486 | elif name in ('-h', '--help'): |
487 | - usage() |
488 | + usage(0) |
489 | elif name == '--version': |
490 | version() |
491 | |
492 | |
493 | === modified file 'bin/euca-describe-groups' |
494 | --- bin/euca-describe-groups 2010-02-21 03:44:16 +0000 |
495 | +++ bin/euca-describe-groups 2010-02-26 15:47:11 +0000 |
496 | @@ -47,10 +47,10 @@ |
497 | """ |
498 | |
499 | |
500 | -def usage(): |
501 | +def usage(status=1): |
502 | print usage_string |
503 | Util().usage() |
504 | - sys.exit() |
505 | + sys.exit(status) |
506 | |
507 | def version(): |
508 | print Util().version() |
509 | @@ -90,7 +90,7 @@ |
510 | |
511 | for name, value in euca.opts: |
512 | if name in ('-h', '--help'): |
513 | - usage() |
514 | + usage(0) |
515 | elif name == '--version': |
516 | version() |
517 | |
518 | |
519 | === modified file 'bin/euca-describe-image-attribute' |
520 | --- bin/euca-describe-image-attribute 2010-02-21 03:44:16 +0000 |
521 | +++ bin/euca-describe-image-attribute 2010-02-26 15:47:11 +0000 |
522 | @@ -57,10 +57,10 @@ |
523 | """ |
524 | |
525 | |
526 | -def usage(): |
527 | +def usage(status=1): |
528 | print usage_string |
529 | Util().usage() |
530 | - sys.exit() |
531 | + sys.exit(status) |
532 | |
533 | def version(): |
534 | print Util().version() |
535 | @@ -116,7 +116,7 @@ |
536 | if not image_attribute: |
537 | image_attribute = 'ramdisk' |
538 | elif name in ('-h', '--help'): |
539 | - usage() |
540 | + usage(0) |
541 | elif name == '--version': |
542 | version() |
543 | |
544 | |
545 | === modified file 'bin/euca-describe-images' |
546 | --- bin/euca-describe-images 2010-02-25 00:49:25 +0000 |
547 | +++ bin/euca-describe-images 2010-02-26 15:47:11 +0000 |
548 | @@ -53,9 +53,10 @@ |
549 | """ |
550 | |
551 | |
552 | -def usage(): |
553 | +def usage(status=1): |
554 | print usage_string |
555 | Util().usage(compat=True) |
556 | + sys.exit(status) |
557 | |
558 | def version(): |
559 | print Util().version() |
560 | @@ -98,7 +99,7 @@ |
561 | |
562 | for name, value in euca.opts: |
563 | if name in ('-h', '--help'): |
564 | - usage() |
565 | + usage(0) |
566 | elif name == '-x': |
567 | if defaults: |
568 | executable_by = [] |
569 | |
570 | === modified file 'bin/euca-describe-instances' |
571 | --- bin/euca-describe-instances 2010-02-21 03:44:16 +0000 |
572 | +++ bin/euca-describe-instances 2010-02-26 15:47:11 +0000 |
573 | @@ -48,10 +48,10 @@ |
574 | """ |
575 | |
576 | |
577 | -def usage(): |
578 | +def usage(status=1): |
579 | print usage_string |
580 | Util().usage() |
581 | - sys.exit() |
582 | + sys.exit(status) |
583 | |
584 | def version(): |
585 | print Util().version() |
586 | @@ -114,7 +114,7 @@ |
587 | |
588 | for name, value in euca.opts: |
589 | if name in ('-h', '--help'): |
590 | - usage() |
591 | + usage(0) |
592 | elif name == '--version': |
593 | version() |
594 | |
595 | |
596 | === modified file 'bin/euca-describe-keypairs' |
597 | --- bin/euca-describe-keypairs 2010-02-21 03:44:16 +0000 |
598 | +++ bin/euca-describe-keypairs 2010-02-26 15:47:11 +0000 |
599 | @@ -48,10 +48,10 @@ |
600 | """ |
601 | |
602 | |
603 | -def usage(): |
604 | +def usage(status=1): |
605 | print usage_string |
606 | Util().usage() |
607 | - sys.exit() |
608 | + sys.exit(status) |
609 | |
610 | def version(): |
611 | print Util().version() |
612 | @@ -79,7 +79,7 @@ |
613 | |
614 | for name, value in euca.opts: |
615 | if name in ('-h', '--help'): |
616 | - usage() |
617 | + usage(0) |
618 | elif name == '--version': |
619 | version() |
620 | |
621 | |
622 | === modified file 'bin/euca-describe-regions' |
623 | --- bin/euca-describe-regions 2010-02-21 03:44:16 +0000 |
624 | +++ bin/euca-describe-regions 2010-02-26 15:47:11 +0000 |
625 | @@ -48,10 +48,10 @@ |
626 | """ |
627 | |
628 | |
629 | -def usage(): |
630 | +def usage(status=1): |
631 | print usage_string |
632 | Util().usage() |
633 | - sys.exit() |
634 | + sys.exit(status) |
635 | |
636 | def version(): |
637 | print Util().version() |
638 | @@ -78,7 +78,7 @@ |
639 | |
640 | for name, value in euca.opts: |
641 | if name in ('-h', '--help'): |
642 | - usage() |
643 | + usage(0) |
644 | elif name == '--version': |
645 | version() |
646 | |
647 | |
648 | === modified file 'bin/euca-describe-snapshots' |
649 | --- bin/euca-describe-snapshots 2010-02-21 03:44:16 +0000 |
650 | +++ bin/euca-describe-snapshots 2010-02-26 15:47:11 +0000 |
651 | @@ -48,10 +48,10 @@ |
652 | """ |
653 | |
654 | |
655 | -def usage(): |
656 | +def usage(status=1): |
657 | print usage_string |
658 | Util().usage() |
659 | - sys.exit() |
660 | + sys.exit(status) |
661 | |
662 | def version(): |
663 | print Util().version() |
664 | @@ -79,7 +79,7 @@ |
665 | |
666 | for name, value in euca.opts: |
667 | if name in ('-h', '--help'): |
668 | - usage() |
669 | + usage(0) |
670 | elif name == '--version': |
671 | version() |
672 | |
673 | |
674 | === modified file 'bin/euca-describe-volumes' |
675 | --- bin/euca-describe-volumes 2010-02-21 03:44:16 +0000 |
676 | +++ bin/euca-describe-volumes 2010-02-26 15:47:11 +0000 |
677 | @@ -48,10 +48,10 @@ |
678 | """ |
679 | |
680 | |
681 | -def usage(): |
682 | +def usage(status=1): |
683 | print usage_string |
684 | Util().usage() |
685 | - sys.exit() |
686 | + sys.exit(status) |
687 | |
688 | def version(): |
689 | print Util().version() |
690 | @@ -94,7 +94,7 @@ |
691 | |
692 | for name, value in euca.opts: |
693 | if name in ('-h', '--help'): |
694 | - usage() |
695 | + usage(0) |
696 | elif name == '--version': |
697 | version() |
698 | |
699 | |
700 | === modified file 'bin/euca-detach-volume' |
701 | --- bin/euca-detach-volume 2010-02-21 03:44:16 +0000 |
702 | +++ bin/euca-detach-volume 2010-02-26 15:47:11 +0000 |
703 | @@ -49,10 +49,10 @@ |
704 | """ |
705 | |
706 | |
707 | -def usage(): |
708 | +def usage(status=1): |
709 | print usage_string |
710 | Util().usage() |
711 | - sys.exit() |
712 | + sys.exit(status) |
713 | |
714 | def version(): |
715 | print Util().version() |
716 | @@ -84,7 +84,7 @@ |
717 | elif name in ('-d', '--device'): |
718 | device = value |
719 | elif name in ('-h', '--help'): |
720 | - usage() |
721 | + usage(0) |
722 | elif name == '--version': |
723 | version() |
724 | |
725 | |
726 | === modified file 'bin/euca-disassociate-address' |
727 | --- bin/euca-disassociate-address 2010-02-21 03:44:16 +0000 |
728 | +++ bin/euca-disassociate-address 2010-02-26 15:47:11 +0000 |
729 | @@ -49,10 +49,10 @@ |
730 | """ |
731 | |
732 | |
733 | -def usage(): |
734 | +def usage(status=1): |
735 | print usage_string |
736 | Util().usage() |
737 | - sys.exit() |
738 | + sys.exit(status) |
739 | |
740 | def version(): |
741 | print Util().version() |
742 | @@ -70,7 +70,7 @@ |
743 | |
744 | for name, value in euca.opts: |
745 | if name in ('-h', '--help'): |
746 | - usage() |
747 | + usage(0) |
748 | elif name == '--version': |
749 | version() |
750 | |
751 | |
752 | === modified file 'bin/euca-download-bundle' |
753 | --- bin/euca-download-bundle 2010-02-21 03:44:16 +0000 |
754 | +++ bin/euca-download-bundle 2010-02-26 15:47:11 +0000 |
755 | @@ -58,10 +58,10 @@ |
756 | """ |
757 | |
758 | |
759 | -def usage(): |
760 | +def usage(status=1): |
761 | print usage_string |
762 | Util().usage() |
763 | - sys.exit() |
764 | + sys.exit(status) |
765 | |
766 | def version(): |
767 | print Util().version() |
768 | @@ -141,7 +141,7 @@ |
769 | |
770 | for name, value in euca.opts: |
771 | if name in ('-h', '--help'): |
772 | - usage() |
773 | + usage(0) |
774 | elif name in ('-d', '--directory'): |
775 | directory = value |
776 | elif name in ('-b', '--bucket'): |
777 | |
778 | === modified file 'bin/euca-get-console-output' |
779 | --- bin/euca-get-console-output 2010-02-21 03:44:16 +0000 |
780 | +++ bin/euca-get-console-output 2010-02-26 15:47:11 +0000 |
781 | @@ -49,10 +49,10 @@ |
782 | """ |
783 | |
784 | |
785 | -def usage(): |
786 | +def usage(status=1): |
787 | print usage_string |
788 | Util().usage() |
789 | - sys.exit() |
790 | + sys.exit(status) |
791 | |
792 | def version(): |
793 | print Util().version() |
794 | @@ -74,7 +74,7 @@ |
795 | |
796 | for name, value in euca.opts: |
797 | if name in ('-h', '--help'): |
798 | - usage() |
799 | + usage(0) |
800 | elif name == '--version': |
801 | version() |
802 | elif name == '--debug': |
803 | |
804 | === modified file 'bin/euca-modify-image-attribute' |
805 | --- bin/euca-modify-image-attribute 2010-02-16 20:46:57 +0000 |
806 | +++ bin/euca-modify-image-attribute 2010-02-26 15:47:11 +0000 |
807 | @@ -58,13 +58,13 @@ |
808 | """ |
809 | |
810 | |
811 | -def usage(): |
812 | +def usage(status=1): |
813 | print usage_string |
814 | Util().usage(compat=True) |
815 | |
816 | def version(): |
817 | print Util().version() |
818 | - sys.exit() |
819 | + sys.exit(status) |
820 | |
821 | def main(): |
822 | euca = None |
823 | @@ -99,7 +99,7 @@ |
824 | entity = value |
825 | operation_type = 'remove' |
826 | elif name in ('-h', '--help'): |
827 | - usage() |
828 | + usage(0) |
829 | elif name == '--version': |
830 | version() |
831 | |
832 | |
833 | === modified file 'bin/euca-reboot-instances' |
834 | --- bin/euca-reboot-instances 2010-02-21 03:44:16 +0000 |
835 | +++ bin/euca-reboot-instances 2010-02-26 15:47:11 +0000 |
836 | @@ -48,10 +48,10 @@ |
837 | """ |
838 | |
839 | |
840 | -def usage(): |
841 | +def usage(status=1): |
842 | print usage_string |
843 | Util().usage() |
844 | - sys.exit() |
845 | + sys.exit(status) |
846 | |
847 | def version(): |
848 | print Util().version() |
849 | @@ -67,7 +67,7 @@ |
850 | |
851 | for name, value in euca.opts: |
852 | if name in ('-h', '--help'): |
853 | - usage() |
854 | + usage(0) |
855 | elif name == '--version': |
856 | version() |
857 | |
858 | |
859 | === modified file 'bin/euca-register' |
860 | --- bin/euca-register 2010-02-21 03:44:16 +0000 |
861 | +++ bin/euca-register 2010-02-26 15:47:11 +0000 |
862 | @@ -49,10 +49,10 @@ |
863 | """ |
864 | |
865 | |
866 | -def usage(): |
867 | +def usage(status=1): |
868 | print usage_string |
869 | Util().usage() |
870 | - sys.exit() |
871 | + sys.exit(status) |
872 | |
873 | def version(): |
874 | print Util().version() |
875 | @@ -70,7 +70,7 @@ |
876 | |
877 | for name, value in euca.opts: |
878 | if name in ('-h', '--help'): |
879 | - usage() |
880 | + usage(0) |
881 | elif name == '--version': |
882 | version() |
883 | |
884 | |
885 | === modified file 'bin/euca-release-address' |
886 | --- bin/euca-release-address 2010-02-21 03:44:16 +0000 |
887 | +++ bin/euca-release-address 2010-02-26 15:47:11 +0000 |
888 | @@ -49,10 +49,10 @@ |
889 | """ |
890 | |
891 | |
892 | -def usage(): |
893 | +def usage(status=1): |
894 | print usage_string |
895 | Util().usage() |
896 | - sys.exit() |
897 | + sys.exit(status) |
898 | |
899 | def version(): |
900 | print Util().version() |
901 | @@ -70,7 +70,7 @@ |
902 | |
903 | for name, value in euca.opts: |
904 | if name in ('-h', '--help'): |
905 | - usage() |
906 | + usage(0) |
907 | elif name == '--version': |
908 | version() |
909 | |
910 | |
911 | === modified file 'bin/euca-reset-image-attribute' |
912 | --- bin/euca-reset-image-attribute 2010-02-21 03:44:16 +0000 |
913 | +++ bin/euca-reset-image-attribute 2010-02-26 15:47:11 +0000 |
914 | @@ -52,10 +52,10 @@ |
915 | """ |
916 | |
917 | |
918 | -def usage(): |
919 | +def usage(status=1): |
920 | print usage_string |
921 | Util().usage() |
922 | - sys.exit() |
923 | + sys.exit(status) |
924 | |
925 | def version(): |
926 | print Util().version() |
927 | @@ -78,7 +78,7 @@ |
928 | if not image_attribute: |
929 | image_attribute = 'launchPermission' |
930 | elif name in ('-h', '--help'): |
931 | - usage() |
932 | + usage(0) |
933 | elif name == '--version': |
934 | version() |
935 | |
936 | |
937 | === modified file 'bin/euca-revoke' |
938 | --- bin/euca-revoke 2010-02-16 20:46:57 +0000 |
939 | +++ bin/euca-revoke 2010-02-26 15:47:11 +0000 |
940 | @@ -64,13 +64,13 @@ |
941 | """ |
942 | |
943 | |
944 | -def usage(): |
945 | +def usage(status=1): |
946 | print usage_string |
947 | Util().usage(compat=True) |
948 | |
949 | def version(): |
950 | print Util().version() |
951 | - sys.exit() |
952 | + sys.exit(status) |
953 | |
954 | def main(): |
955 | euca = None |
956 | @@ -117,7 +117,7 @@ |
957 | print "port must be an integer." |
958 | sys.exit(1) |
959 | elif name in ('-h', '--help'): |
960 | - usage() |
961 | + usage(0) |
962 | elif name == '--version': |
963 | version() |
964 | |
965 | |
966 | === modified file 'bin/euca-run-instances' |
967 | --- bin/euca-run-instances 2010-02-21 03:44:16 +0000 |
968 | +++ bin/euca-run-instances 2010-02-26 15:47:11 +0000 |
969 | @@ -71,10 +71,10 @@ |
970 | """ |
971 | |
972 | |
973 | -def usage(): |
974 | +def usage(status=1): |
975 | print usage_string |
976 | Util().usage() |
977 | - sys.exit() |
978 | + sys.exit(status) |
979 | |
980 | def version(): |
981 | print Util().version() |
982 | @@ -152,7 +152,7 @@ |
983 | elif name in ('-z', '--availability-zone'): |
984 | zone = value |
985 | elif name in ('-h', '--help'): |
986 | - usage() |
987 | + usage(0) |
988 | elif name == '--version': |
989 | version() |
990 | |
991 | |
992 | === modified file 'bin/euca-terminate-instances' |
993 | --- bin/euca-terminate-instances 2010-02-21 03:44:16 +0000 |
994 | +++ bin/euca-terminate-instances 2010-02-26 15:47:11 +0000 |
995 | @@ -50,10 +50,10 @@ |
996 | """ |
997 | |
998 | |
999 | -def usage(): |
1000 | +def usage(status=1): |
1001 | print usage_string |
1002 | Util().usage() |
1003 | - sys.exit() |
1004 | + sys.exit(status) |
1005 | |
1006 | def version(): |
1007 | print Util().version() |
1008 | @@ -73,7 +73,7 @@ |
1009 | |
1010 | for name, value in euca.opts: |
1011 | if name in ('-h', '--help'): |
1012 | - usage() |
1013 | + usage(0) |
1014 | elif name == '--version': |
1015 | version() |
1016 | |
1017 | |
1018 | === modified file 'bin/euca-unbundle' |
1019 | --- bin/euca-unbundle 2010-02-21 03:44:16 +0000 |
1020 | +++ bin/euca-unbundle 2010-02-26 15:47:11 +0000 |
1021 | @@ -69,10 +69,10 @@ |
1022 | IMAGE_IO_CHUNK = 8 * 1024 |
1023 | IMAGE_SPLIT_CHUNK = IMAGE_IO_CHUNK * 1024; |
1024 | |
1025 | -def usage(): |
1026 | +def usage(status=1): |
1027 | print usage_string |
1028 | Util().usage() |
1029 | - sys.exit() |
1030 | + sys.exit(status) |
1031 | |
1032 | def version(): |
1033 | print Util().version() |
1034 | @@ -98,7 +98,7 @@ |
1035 | |
1036 | for name, value in euca.opts: |
1037 | if name in ('-h', '--help'): |
1038 | - usage() |
1039 | + usage(0) |
1040 | elif name in ('-k', '--privatekey'): |
1041 | private_key_path = value |
1042 | elif name in ('-m', '--manifest'): |
1043 | |
1044 | === modified file 'bin/euca-upload-bundle' |
1045 | --- bin/euca-upload-bundle 2010-02-21 03:44:16 +0000 |
1046 | +++ bin/euca-upload-bundle 2010-02-26 15:47:11 +0000 |
1047 | @@ -67,10 +67,10 @@ |
1048 | """ |
1049 | |
1050 | |
1051 | -def usage(): |
1052 | +def usage(status=1): |
1053 | print usage_string |
1054 | Util().usage() |
1055 | - sys.exit() |
1056 | + sys.exit(status) |
1057 | |
1058 | def version(): |
1059 | print Util().version() |
1060 | @@ -178,7 +178,7 @@ |
1061 | |
1062 | for name, value in euca.opts: |
1063 | if name in ('-h', '--help'): |
1064 | - usage() |
1065 | + usage(0) |
1066 | elif name in ('-b', '--bucket'): |
1067 | bucket = value |
1068 | elif name in ('-m', '--manifest'): |
1069 | |
1070 | === modified file 'bin/euca-version' |
1071 | --- bin/euca-version 2010-02-16 20:46:57 +0000 |
1072 | +++ bin/euca-version 2010-02-26 15:47:11 +0000 |
1073 | @@ -46,9 +46,9 @@ |
1074 | """ |
1075 | |
1076 | |
1077 | -def usage(): |
1078 | +def usage(status=1): |
1079 | print usage_string |
1080 | - sys.exit() |
1081 | + sys.exit(status) |
1082 | |
1083 | def version(): |
1084 | print Util().version() |
1085 | @@ -67,7 +67,7 @@ |
1086 | |
1087 | for name, value in euca.opts: |
1088 | if name in ('-h', '--help'): |
1089 | - usage() |
1090 | + usage(0) |
1091 | |
1092 | display_tools_version() |
1093 | |
1094 | |
1095 | === modified file 'euca2ools/euca2ools/__init__.py' |
1096 | --- euca2ools/euca2ools/__init__.py 2010-02-21 03:44:16 +0000 |
1097 | +++ euca2ools/euca2ools/__init__.py 2010-02-26 15:47:11 +0000 |
1098 | @@ -346,47 +346,25 @@ |
1099 | SYSTEM_EUCARC_PATH = os.path.join("/etc", "euca2ools", "eucarc") |
1100 | |
1101 | def setup_environ(self): |
1102 | + envlist = ( 'EC2_ACCESS_KEY', 'EC2_SECRET_KEY', 'S3_URL', 'EC2_URL', |
1103 | + 'EC2_CERT', 'EC2_PRIVATE_KEY', 'EUCALYPTUS_CERT', |
1104 | + 'EC2_USER_ID' ) |
1105 | self.environ = {} |
1106 | user_eucarc = None |
1107 | if 'HOME' in os.environ: |
1108 | user_eucarc = os.path.join(os.getenv('HOME'), ".eucarc") |
1109 | - base_path = None |
1110 | read_config = False |
1111 | if self.config_file_path and os.path.exists(self.config_file_path): |
1112 | - base_path = os.path.dirname(self.config_file_path) |
1113 | - eucarc = open(self.config_file_path, "r") |
1114 | - read_config = True |
1115 | + read_config = self.config_file_path |
1116 | elif user_eucarc is not None and os.path.exists(user_eucarc): |
1117 | - base_path = os.path.dirname(user_eucarc) |
1118 | - eucarc = open(user_eucarc, "r") |
1119 | - read_config = True |
1120 | + read_config = user_eucarc |
1121 | elif os.path.exists(self.SYSTEM_EUCARC_PATH): |
1122 | - base_path = os.path.dirname(self.SYSTEM_EUCARC_PATH) |
1123 | - eucarc = open(self.SYSTEM_EUCARC_PATH, "r") |
1124 | - read_config = True |
1125 | + read_config = self.SYSTEM_EUCARC_PATH |
1126 | if read_config: |
1127 | - lines = eucarc.readlines() |
1128 | - comment = re.compile('^#') |
1129 | - for line in lines: |
1130 | - line = line.strip('export') |
1131 | - line = line.replace('\'', '') |
1132 | - line = line.strip() |
1133 | - line = line.replace('${EUCA_KEY_DIR}', base_path) |
1134 | - if not comment.match(line): |
1135 | - parts = line.split('=', 1) |
1136 | - if len(parts) == 2: |
1137 | - self.environ[parts[0]] = parts[1] |
1138 | - eucarc.close() |
1139 | - |
1140 | + parse_config(read_config, self.environ, envlist) |
1141 | else: |
1142 | - self.environ['EC2_ACCESS_KEY'] = os.getenv('EC2_ACCESS_KEY') |
1143 | - self.environ['EC2_SECRET_KEY'] = os.getenv('EC2_SECRET_KEY') |
1144 | - self.environ['S3_URL'] = os.getenv('S3_URL') |
1145 | - self.environ['EC2_URL'] = os.getenv('EC2_URL') |
1146 | - self.environ['EC2_CERT'] = os.getenv('EC2_CERT') |
1147 | - self.environ['EC2_PRIVATE_KEY'] = os.getenv('EC2_PRIVATE_KEY') |
1148 | - self.environ['EUCALYPTUS_CERT'] = os.getenv('EUCALYPTUS_CERT') |
1149 | - self.environ['EC2_USER_ID'] = os.getenv('EC2_USER_ID') |
1150 | + for v in envlist: |
1151 | + self.environ[v]=os.getenv(v) |
1152 | |
1153 | def get_environ(self, name): |
1154 | if self.environ.has_key(name): |
1155 | @@ -1094,3 +1072,27 @@ |
1156 | except Exception: |
1157 | print msg |
1158 | sys.exit(1) |
1159 | + |
1160 | +# read the config file 'config', update 'dict', setting |
1161 | +# the value from the config file for each element in array 'keylist' |
1162 | +# "config" is a bash syntax file defining bash variables |
1163 | +def parse_config(config, dict, keylist): |
1164 | + fmt = "" |
1165 | + str="" |
1166 | + for v in keylist: |
1167 | + str='%s "${%s}" ' % (str, v) |
1168 | + fmt=fmt + "%s%s" % ("%s", "\\0") |
1169 | + |
1170 | + cmd = [ "bash", "-ec", |
1171 | + ". '%s' >/dev/null; printf '%s' %s" \ |
1172 | + % ( config, fmt, str ) ] |
1173 | + |
1174 | + handle = Popen(cmd, stderr=PIPE, stdout=PIPE) |
1175 | + ( stdout, stderr) = handle.communicate() |
1176 | + if handle.returncode != 0: |
1177 | + raise Exception("Parsing config file %s failed:\n\t%s" %(config, stderr)) |
1178 | + |
1179 | + values = stdout.split("\0") |
1180 | + for i in range(len(values) - 1): |
1181 | + if values[i] != "": |
1182 | + dict[keylist[i]]=values[i] |
This branch fixes 2 small-ish problems with euca2ools.
- bug 526591
- Exception resulting in usage() would exit status=0 in most cases.
In some, exceptions were ignored all together because usage did not sys.exit