Merge lp:~rvb/maas/dhcp-multiple-intf into lp:~maas-committers/maas/trunk
Proposed by
Raphaël Badin
Status: | Merged |
---|---|
Approved by: | Raphaël Badin |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1859 |
Proposed branch: | lp:~rvb/maas/dhcp-multiple-intf |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
402 lines (+132/-95) 7 files modified
etc/maas/templates/dhcp/dhcpd.conf.template (+12/-9) src/maasserver/dhcp.py (+24/-18) src/maasserver/tests/test_dhcp.py (+53/-23) src/provisioningserver/dhcp/config.py (+3/-19) src/provisioningserver/dhcp/tests/test_config.py (+24/-20) src/provisioningserver/dhcp/writer.py (+9/-3) src/provisioningserver/tests/test_tasks.py (+7/-3) |
To merge this branch: | bzr merge lp:~rvb/maas/dhcp-multiple-intf |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | Approve | ||
Review via email: mp+203325@code.launchpad.net |
Commit message
Generate a multiple-network DHCP config.
Description of the change
This branch changes the DHCP-config writing code so that it can write multiple-network DHCP configs. I've tested that there is no regression by building a package from this branch and testing it in the lab.
Now, we're still in the process of testing if it's worth adding an "interface <intf>" statement inside each subnet definition. If it works, we will fix this as a follow-up branch.
To post a comment you must log in.
Thanks! In a way I think the code got simpler here — the network information is now more encapsulated.
A small note: in rc/provisioning server/ dhcp/config. py (starting around line 45) you now have...
except KeyError as error: (*error. args) (*error. args)
raise DHCPConfigError
except NameError as error:
raise DHCPConfigError
You can write that as simply:
except (KeyError, NameError) as error: (*error. args)
raise DHCPConfigError
Python's authors have thought of these things. :-)
The big loop in src/maasserver/ dhcp.py (starting around line 60) looks like it now wants to be a list comprehension, with its body extracted into a separate function. But no biggie.