Merge lp:~tycho-s/maas/add-hardcode-amt-option into lp:~maas-committers/maas/trunk

Proposed by Tycho Andersen
Status: Merged
Approved by: Tycho Andersen
Approved revision: no longer in the source branch.
Merged at revision: 2276
Proposed branch: lp:~tycho-s/maas/add-hardcode-amt-option
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 36 lines (+11/-0)
2 files modified
etc/maas/templates/power/amt.template (+7/-0)
src/provisioningserver/power_schema.py (+4/-0)
To merge this branch: bzr merge lp:~tycho-s/maas/add-hardcode-amt-option
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+215953@code.launchpad.net

Commit message

Add optional power_address field to AMT template to allow manual overriding of the default IP address.

Description of the change

Add optional power_address field to AMT template to allow manual overriding of the default IP address.

To post a comment you must log in.
Revision history for this message
Tycho Andersen (tycho-s) wrote :

One thing to note is that this needs to go into Trusty as I understand it, so it probably needs to go in 1.5 as well. I'm not exactly sure how to lp-fu that, so if someone has some instrucitons, that would be great :-)

Revision history for this message
Raphaël Badin (rvb) wrote :

Looks good, but please confirm that you've QAed this. This close to the release, we're being cautious for things that touch that part of the code (see [0]).

[0]

I'm assuming this has been tested in the field… right?

(Note that the existing unit tests will only check that the template can be rendered correctly)

[1]

31 + 'power_address', "Optional IP to use instead of MAC"),

This is a bit vague (what does it mean to use an IP instead of a MAC). *I* understand what you mean because I know what this is about but you have to put yourself in the shoes of a user. Maybe have a look at the comments for IPMI parameters for inspiration.

[2]

Please confirm this with Andres but I think this needs to be linked to a bug in order to make it into 1.5.

[3]

> One thing to note is that this needs to go into Trusty as I understand it, so it probably needs to go in 1.5 as well.
> I'm not exactly sure how to lp-fu that, so if someone has some instrucitons, that would be great :-)

Once this is landed, create a branch off lp:maas/1.5, cherry pick the revision where this branch has landed: bzr -c <rev_number> lp:maas then create a MP for this branch with lp:maas/1.5 as the target.

review: Needs Information
Revision history for this message
Tycho Andersen (tycho-s) wrote :

On Wed, Apr 16, 2014 at 12:48:40PM -0000, Raphaël Badin wrote:
> Review: Needs Information
>
> Looks good, but please confirm that you've QAed this. This close to the release, we're being cautious for things that touch that part of the code (see [0]).
>
> [0]
>
> I'm assuming this has been tested in the field… right?

Yep. However, it is worth noting that the power_address field doesn't
have any validation (that it is an actual IP address), so if you type
something wrong in there it won't work. This is a bug with every other
IP address field as well, though.

> (Note that the existing unit tests will only check that the template can be rendered correctly)
>
>
> [1]
>
> 31 + 'power_address', "Optional IP to use instead of MAC"),
>
> This is a bit vague (what does it mean to use an IP instead of a MAC). *I* understand what you mean because I know what this is about but you have to put yourself in the shoes of a user. Maybe have a look at the comments for IPMI parameters for inspiration.

Done.

> [2]
>
> Please confirm this with Andres but I think this needs to be linked to a bug in order to make it into 1.5.

Checked with him, we do, and I've created one and linked it everywhere
I think (?). Let me know if there are more places that I missed.

> [3]
>
> > One thing to note is that this needs to go into Trusty as I understand it, so it probably needs to go in 1.5 as well.
> > I'm not exactly sure how to lp-fu that, so if someone has some instrucitons, that would be great :-)
>
> Once this is landed, create a branch off lp:maas/1.5, cherry pick the revision where this branch has landed: bzr -c <rev_number> lp:maas then create a MP for this branch with lp:maas/1.5 as the target.

Excellent, thank you.

\t

Revision history for this message
Raphaël Badin (rvb) wrote :

All right, thanks for the replies.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/maas/templates/power/amt.template'
2--- etc/maas/templates/power/amt.template 2014-02-17 21:00:17 +0000
3+++ etc/maas/templates/power/amt.template 2014-04-16 21:49:03 +0000
4@@ -2,10 +2,17 @@
5 # -*- mode: shell-script -*-
6 #
7 # Control a system via amttool
8+power_address='{{power_address}}'
9 power_change='{{power_change}}'
10 power_pass='{{power_pass}}'
11 ip_address='{{ip_address}}'
12
13+# The user specified power_address overrides any automatically determined
14+# ip_address.
15+if [ -n "$power_address" ]; then
16+ ip_address=$power_address
17+fi
18+
19 echo amt.template starting $*
20
21 echo ip_address $ip_address
22
23=== modified file 'src/provisioningserver/power_schema.py'
24--- src/provisioningserver/power_schema.py 2014-03-27 04:15:45 +0000
25+++ src/provisioningserver/power_schema.py 2014-04-16 21:49:03 +0000
26@@ -226,6 +226,10 @@
27 make_json_field(
28 'mac_address', "MAC Address", field_type='mac_address'),
29 make_json_field('power_pass', "Power password"),
30+ make_json_field(
31+ 'power_address',
32+ "An IP address to use instead of the node's primary NIC's IP "
33+ "(i.e. the IP of the MAC above, looked up with ARP)."),
34 ],
35 },
36 {