Merge lp:~rvb/maas/subnet-calc2 into lp:~maas-committers/maas/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Raphaël Badin | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 972 | ||||
Proposed branch: | lp:~rvb/maas/subnet-calc2 | ||||
Merge into: | lp:~maas-committers/maas/trunk | ||||
Diff against target: |
65 lines (+8/-10) 3 files modified
src/maasserver/models/nodegroup.py (+4/-4) src/maasserver/tests/test_commands_config_master_dhcp.py (+0/-2) src/maasserver/tests/test_nodegroup.py (+4/-4) |
||||
To merge this branch: | bzr merge lp:~rvb/maas/subnet-calc2 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+122702@code.launchpad.net |
Commit message
Fix the 'subnet' used when writing DHCP configuration files.
Description of the change
This branch fixes the subnet used when writing the DHCP configuration file. The value used was the nodegroup's ip_range_low value and that is obviously wrong as the nodegroup's subnet_mask needs to be applied.
= Pre-imp =
No real pre-imp for this but the fix is rather straightforward.
= Notes =
Instead of fiddling with IP addresses manually, I use the netaddr module to do the heavy lifting.
I thought it was clearer to fix the network config of the nodegroup used in the test. The alternative would have been to continue using a random one but in this case I would have to redo the computation of the subnet in the test the same way it's done in the code and the test would not have been very interesting.