Merge lp:~andreserl/maas/lp1073462_fence_cdu_power_type into lp:maas/trunk
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Raphaël Badin on 2012-12-20 | ||||
| Approved revision: | 1406 | ||||
| Merged at revision: | 1410 | ||||
| Proposed branch: | lp:~andreserl/maas/lp1073462_fence_cdu_power_type | ||||
| Merge into: | lp:maas/trunk | ||||
| Diff against target: |
148 lines (+93/-0) 5 files modified
src/maasserver/models/node.py (+1/-0) src/maasserver/power_parameters.py (+20/-0) src/provisioningserver/enum.py (+4/-0) src/provisioningserver/power/templates/fence_cdu.template (+54/-0) src/provisioningserver/power/tests/test_poweraction.py (+14/-0) |
||||
| To merge this branch: | bzr merge lp:~andreserl/maas/lp1073462_fence_cdu_power_type | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jeroen T. Vermeulen (community) | 2012-12-18 | Approve on 2012-12-19 | |
|
Review via email:
|
|||
Commit Message
Add fence_cdu power type for SentrySwitch CDU's.
| Andres Rodriguez (andreserl) wrote : | # |
Hi Jeroen,
Thanks for the review!
[1] I don't understand it :). The only place where a line-break would be required is inside the test_fence_
134 + script = action.
135 + action.
136 + power_address=
137 + power_user='me', power_pass='me', fence_cdu='echo')
[2]: Fixed.
Thanks!
| Raphaël Badin (rvb) wrote : | # |
I think Jeroen was referring to that piece of code:
24 + 'power_id',
25 + forms.CharField
26 + required=False)),
27 + (
28 + 'power_address',
29 + forms.CharField
30 + required=False)),
Instead of:
forms.CharField
required=
You should write:
forms.CharField(
label="Power ID", required=False))
| MAAS Lander (maas-lander) wrote : | # |
The Jenkins job https:/
Not merging it.


Looks very nice.
Two small notes:
1. In python, when we have to line-break the arguments to a function call, we start doing so right after the opening parenthesis, so that the arguments start on a line of their own.
So instead of:
call_ function( one_argument,
another_ argument, final_argument)
...we say:
call_function(
one_argument, another_argument,
final_ argument)
2. It would be nice if the test explained (in a comment, doesn't need to be very long) how the error condition happens. As I understand it, you substitute "echo" for the power command, and when that command gets called, you get something that isn't recognized as a power state.
I think I probably did this myself at some point. But reading it back now, I realize it's not obvious. So for the sake of whoever maintains the code next, it would be helpful to point out this subtlety.
Jeroen