Merge lp:~allenap/maas/remove-ip-from-amt into lp:~maas-committers/maas/trunk
Proposed by
Gavin Panella
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1944 |
Proposed branch: | lp:~allenap/maas/remove-ip-from-amt |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
109 lines (+45/-5) 4 files modified
etc/maas/templates/power/amt.template (+3/-4) src/maasserver/power_parameters.py (+2/-1) src/provisioningserver/tasks.py (+2/-0) src/provisioningserver/tests/test_tasks.py (+38/-0) |
To merge this branch: | bzr merge lp:~allenap/maas/remove-ip-from-amt |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+206057@code.launchpad.net |
Commit message
Don't record IP address in AMT power parameters.
Instead use its MAC address to find it on the network because we cannot guarantee that the recorded IP address will not change.
Description of the change
This is based on Tycho's work in lp:~tycho-s/maas/remove-ip-from-amt.
To post a comment you must log in.
Mostly fine but a question and a nit! Setting to approved though as I don't want to block you.
[1] 'ip_address' ] = find_ip_ via_arp( kwargs[ 'mac_address' ])
49 + if 'mac_address' in kwargs:
50 + kwargs[
If ip_address is not set, then the template will blow up. Why would mac_address not be set in kwargs here?
[2]
You're using a bit of a testing antipattern by initialising sentinel.ip_address in the setup and then depending on it in the test assertions. I think it would be better if each test patched out this separately, despite the lack of factoring.
BTW I think we should use more sentinel, it's much easier on the eye that the factory. makeRandomXXX stuff!