launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11567
[Merge] lp:~jtv/maas/dhcp-interface-cli into lp:maas
Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/dhcp-interface-cli into lp:maas with lp:~jtv/maas/dhcp-interface-db as a prerequisite.
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~jtv/maas/dhcp-interface-cli/+merge/122475
Not separately pre-imped, but have been discussing the general thrust of this work with Julian.
A subsequent branch will pass the setting on to dhcpd. The only viable place to do it seems to be in /etc/defaults/.
Jeroen
--
https://code.launchpad.net/~jtv/maas/dhcp-interface-cli/+merge/122475
Your team MAAS Maintainers is requested to review the proposed merge of lp:~jtv/maas/dhcp-interface-cli into lp:maas.
=== modified file 'src/maasserver/management/commands/config_master_dhcp.py'
--- src/maasserver/management/commands/config_master_dhcp.py 2012-08-24 10:07:51 +0000
+++ src/maasserver/management/commands/config_master_dhcp.py 2012-09-03 09:11:19 +0000
@@ -32,6 +32,7 @@
dhcp_items = {
+ 'dhcp_interface': "Network interface that should service DHCP requests.",
'subnet_mask': "Subnet mask, e.g. 255.0.0.0",
'broadcast_ip': "Broadcast address for this subnet, e.g. 10.255.255.255",
'router_ip': "Address of default gateway.",
@@ -43,6 +44,10 @@
# DHCP settings when disabled.
clear_settings = {item: None for item in dhcp_items}
+# Django is weird with null strings. Not all settings use None as the
+# not-set value.
+clear_settings['dhcp_interface'] = ''
+
def get_settings(options):
"""Get the DHCP settings from `options`, as a dict.
=== modified file 'src/maasserver/tests/test_commands_config_master_dhcp.py'
--- src/maasserver/tests/test_commands_config_master_dhcp.py 2012-08-31 15:43:12 +0000
+++ src/maasserver/tests/test_commands_config_master_dhcp.py 2012-09-03 09:11:19 +0000
@@ -38,6 +38,7 @@
def make_dhcp_settings():
"""Return an arbitrary dict of DHCP settings."""
return {
+ 'dhcp_interface': factory.make_name('interface'),
'subnet_mask': '255.255.0.0',
'broadcast_ip': '10.111.255.255',
'router_ip': factory.getRandomIPAddress(),
Follow ups