Merge lp:~frankban/lpsetup/install-lxc-stops-lxc into lp:lpsetup

Proposed by Francesco Banconi
Status: Merged
Approved by: Gary Poster
Approved revision: 59
Merged at revision: 59
Proposed branch: lp:~frankban/lpsetup/install-lxc-stops-lxc
Merge into: lp:lpsetup
Diff against target: 62 lines (+6/-6)
3 files modified
lpsetup/subcommands/initlxc.py (+2/-2)
lpsetup/subcommands/install_lxc.py (+2/-2)
lpsetup/tests/subcommands/test_install_lxc.py (+2/-2)
To merge this branch: bzr merge lp:~frankban/lpsetup/install-lxc-stops-lxc
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
Review via email: mp+116250@code.launchpad.net

Commit message

install-lxc can stop the container at the end of the process

Description of the change

== Changes ==

Moved the *stop_lxc* step so that it is the last step executed by install-lxc.

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Hi Francesco. This looks fine, and I'll approve it in order to move the card along in your absence. That said, I do wonder why you arranged the tuples the way you did. I'd be inclined to slightly simplify things as follows:

=== modified file 'lpsetup/subcommands/install_lxc.py'
--- lpsetup/subcommands/install_lxc.py 2012-07-20 16:18:59 +0000
+++ lpsetup/subcommands/install_lxc.py 2012-07-23 18:31:43 +0000
@@ -120,7 +120,8 @@
          'external_path', 'target_dir', 'use_http'),
         (finish_inithost_in_lxc, 'lxc_name', 'ssh_key_path', 'home_dir',
          'user', 'target_dir'),
- ) + (initlxc.SubCommand.stop_lxc_step,)
+ # Run on host:
+ initlxc.SubCommand.stop_lxc_step,)

     help = __doc__

=== modified file 'lpsetup/tests/subcommands/test_install_lxc.py'
--- lpsetup/tests/subcommands/test_install_lxc.py 2012-07-20 16:18:59 +0000
+++ lpsetup/tests/subcommands/test_install_lxc.py 2012-07-23 18:31:17 +0000
@@ -61,6 +61,6 @@
         init_repo_in_lxc_step,
         update_in_lxc_step,
         finish_inithost_in_lxc_step,
- ) + (test_initlxc.stop_lxc_step,)
+ test_initlxc.stop_lxc_step,)
     needs_root = True
     maxDiff = None

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lpsetup/subcommands/initlxc.py'
2--- lpsetup/subcommands/initlxc.py 2012-07-18 10:53:15 +0000
3+++ lpsetup/subcommands/initlxc.py 2012-07-23 11:30:30 +0000
4@@ -226,7 +226,7 @@
5 stop_lxc_step = (stop_lxc,
6 'lxc_name', 'ssh_key_path')
7
8- steps = (
9+ base_steps = (
10 (initialize, 'user'),
11 inithost.SubCommand.setup_home_step,
12 create_lxc_step,
13@@ -234,8 +234,8 @@
14 wait_for_lxc_step,
15 install_lpsetup_in_lxc_step,
16 inithost_in_lxc_step,
17- stop_lxc_step,
18 )
19+ steps = base_steps + (stop_lxc_step,)
20
21 help = __doc__
22 needs_root = True
23
24=== modified file 'lpsetup/subcommands/install_lxc.py'
25--- lpsetup/subcommands/install_lxc.py 2012-07-20 14:51:13 +0000
26+++ lpsetup/subcommands/install_lxc.py 2012-07-23 11:30:30 +0000
27@@ -109,7 +109,7 @@
28 development model.
29 """
30
31- steps = initlxc.SubCommand.steps + (
32+ steps = initlxc.SubCommand.base_steps + (
33 # Run on host:
34 (create_scripts, 'lxc_name', 'ssh_key_path', 'user'),
35 # Run inside the container:
36@@ -120,7 +120,7 @@
37 'external_path', 'target_dir', 'use_http'),
38 (finish_inithost_in_lxc, 'lxc_name', 'ssh_key_path', 'home_dir',
39 'user', 'target_dir'),
40- )
41+ ) + (initlxc.SubCommand.stop_lxc_step,)
42
43 help = __doc__
44
45
46=== modified file 'lpsetup/tests/subcommands/test_install_lxc.py'
47--- lpsetup/tests/subcommands/test_install_lxc.py 2012-07-20 10:40:43 +0000
48+++ lpsetup/tests/subcommands/test_install_lxc.py 2012-07-23 11:30:30 +0000
49@@ -56,11 +56,11 @@
50 handlers.handle_source,
51 handlers.handle_target_from_repository,
52 )
53- expected_steps = test_initlxc.InitLxcTest.expected_steps + (
54+ expected_steps = test_initlxc.InitLxcTest.expected_steps[:-1] + (
55 create_scripts_step,
56 init_repo_in_lxc_step,
57 update_in_lxc_step,
58 finish_inithost_in_lxc_step,
59- )
60+ ) + (test_initlxc.stop_lxc_step,)
61 needs_root = True
62 maxDiff = None

Subscribers

People subscribed via source and target branches

to all changes: