Merge lp:~frankban/lpsetup/use-lxcip into lp:lpsetup
Status: | Merged |
---|---|
Approved by: | Gary Poster |
Approved revision: | 24 |
Merged at revision: | 18 |
Proposed branch: | lp:~frankban/lpsetup/use-lxcip |
Merge into: | lp:lpsetup |
Diff against target: |
523 lines (+215/-60) 7 files modified
lp-setup (+3/-1) lpsetup/cli.py (+5/-1) lpsetup/exceptions.py (+7/-3) lpsetup/settings.py (+2/-3) lpsetup/subcommands/lxcinstall.py (+27/-37) lpsetup/tests/test_utils.py (+84/-3) lpsetup/utils.py (+87/-12) |
To merge this branch: | bzr merge lp:~frankban/lpsetup/use-lxcip |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gary Poster (community) | Approve | ||
Review via email: mp+104350@code.launchpad.net |
Description of the change
== Changes ==
lpsetup no longer changes resolv.conf and dhcp files.
Each ssh connection is made using the container's ip address, obtained from *lp-lxc-ip*.
Changed the lxc template filename, and how the bridge interface is retrieved: now the script looks for interface existence: lxcbr0 first, virbr0 as a fallback, error otherwise (see get_lxc_gateway).
Fixed the script error handling: now lpsetup exists with the expected return code.
Removed the `wait_for_lxc` step: each ssh call systematically retries to obtain the ip address and establish the connection, for ~30 seconds.
== Tests ==
$ nosetests
.......
Name Stmts Miss Cover Missing
-------
lpsetup 6 1 83% 16
lpsetup.argparser 125 6 95% 113, 221, 278-279, 298, 307
lpsetup.exceptions 6 0 100%
lpsetup.handlers 55 1 98% 55
lpsetup.settings 29 0 100%
lpsetup.subcommands 0 0 100%
lpsetup.utils 125 28 78% 80, 114-124, 132-133, 148, 199, 209, 230-232, 250-256, 275-277
-------
TOTAL 346 36 90%
-------
Ran 56 tests in 0.579s
OK
Another great branch, frankban.
A summary of our IRC conversation follows. I requested some small changes.
* This is a great improvement to simplicity and robustness.
* Let's not catch MemoryError in cli.main(): the traceback might in fact be a valuable diagnostic.
* I don't think we should retry sshlxc, because we only want to retry the lxcip call and verify that the sshd is up. Once the sshd is up, we should not retry a failed command. It may have had an effect before it blew up, and there are no guarantees that a retry is appropriate. Instead, we probably should retry the lxcip call, and use wait_for_lxc to verify that the sshd is ready before we try the command (once).
Thank you!