Merge lp:~andreserl/maas/lp_1459865 into lp:maas/trunk

Proposed by Andres Rodriguez on 2015-08-12
Status: Merged
Approved by: Andres Rodriguez on 2015-08-12
Approved revision: 4181
Merged at revision: 4182
Proposed branch: lp:~andreserl/maas/lp_1459865
Merge into: lp:maas/trunk
Diff against target: 36 lines (+14/-1)
2 files modified
src/provisioningserver/kernel_opts.py (+1/-1)
src/provisioningserver/tests/test_kernel_opts.py (+13/-0)
To merge this branch: bzr merge lp:~andreserl/maas/lp_1459865
Reviewer Review Type Date Requested Status
Andres Rodriguez Approve on 2015-08-12
Blake Rouse 2015-08-12 Approve on 2015-08-12
Review via email: mp+267836@code.launchpad.net

Commit message

Fix LP: #1459865: Fix enlistment by ensuring correct kernel parameters are being passed.

To post a comment you must log in.
Blake Rouse (blake-rouse) wrote :

Adjust the if and a test would be nice for this.

review: Approve
lp:~andreserl/maas/lp_1459865 updated on 2015-08-12
4181. By Andres Rodriguez on 2015-08-12

Add tests

review: Approve
Christian Reis (kiko) wrote :

No test?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/provisioningserver/kernel_opts.py'
2--- src/provisioningserver/kernel_opts.py 2015-07-09 13:38:56 +0000
3+++ src/provisioningserver/kernel_opts.py 2015-08-12 16:33:34 +0000
4@@ -127,7 +127,7 @@
5
6 def compose_purpose_opts(params):
7 """Return the list of the purpose-specific kernel options."""
8- if params.purpose == "commissioning" or params.purpose == "xinstall":
9+ if params.purpose in ["commissioning", "xinstall", "enlist"]:
10 # These are kernel parameters read by the ephemeral environment.
11 tname = prefix_target_name(
12 get_ephemeral_name(
13
14=== modified file 'src/provisioningserver/tests/test_kernel_opts.py'
15--- src/provisioningserver/tests/test_kernel_opts.py 2015-07-09 13:38:56 +0000
16+++ src/provisioningserver/tests/test_kernel_opts.py 2015-08-12 16:33:34 +0000
17@@ -216,6 +216,19 @@
18 "overlayroot=tmpfs",
19 "ip=::::%s:BOOTIF" % params.hostname]))
20
21+ def test_enlist_compose_kernel_command_line_inc_purpose_opts(self):
22+ # The result of compose_kernel_command_line includes the purpose
23+ # options for a non "commissioning" node.
24+ params = self.make_kernel_parameters(purpose="enlist")
25+ cmdline = compose_kernel_command_line(params)
26+ self.assertThat(
27+ cmdline,
28+ ContainsAll([
29+ "root=/dev/disk/by-path/ip-",
30+ "iscsi_initiator=",
31+ "overlayroot=tmpfs",
32+ "ip=::::%s:BOOTIF" % params.hostname]))
33+
34 def test_commissioning_compose_kernel_command_line_inc_extra_opts(self):
35 mock_get_curtin_sep = self.patch(
36 kernel_opts, 'get_curtin_kernel_cmdline_sep')