Merge lp:~jtv/maas/1.5-bug-1306335 into lp:maas/1.5

Proposed by Jeroen T. Vermeulen on 2014-04-11
Status: Merged
Approved by: Jeroen T. Vermeulen on 2014-04-11
Approved revision: 2242
Merged at revision: 2242
Proposed branch: lp:~jtv/maas/1.5-bug-1306335
Merge into: lp:maas/1.5
Diff against target: 32 lines (+10/-1)
2 files modified
etc/maas/templates/dhcp/dhcpd.conf.template (+1/-1)
src/provisioningserver/dhcp/tests/test_config.py (+9/-0)
To merge this branch: bzr merge lp:~jtv/maas/1.5-bug-1306335
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve on 2014-04-11
Review via email: mp+215349@code.launchpad.net

Commit message

Backport trunk r2257: Quote interface name in dhcpd.conf; required when the interface name contains dots (or perhaps other strange characters).

To post a comment you must log in.
Jeroen T. Vermeulen (jtv) wrote :

Straight backport; self-approving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/maas/templates/dhcp/dhcpd.conf.template'
2--- etc/maas/templates/dhcp/dhcpd.conf.template 2014-03-21 19:01:40 +0000
3+++ etc/maas/templates/dhcp/dhcpd.conf.template 2014-04-11 05:22:42 +0000
4@@ -9,7 +9,7 @@
5 {{for dhcp_subnet in dhcp_subnets}}
6 subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
7 {{bootloader}}
8- interface {{dhcp_subnet['interface']}};
9+ interface "{{dhcp_subnet['interface']}}";
10 ignore-client-uids true;
11 option subnet-mask {{dhcp_subnet['subnet_mask']}};
12 option broadcast-address {{dhcp_subnet['broadcast_ip']}};
13
14=== modified file 'src/provisioningserver/dhcp/tests/test_config.py'
15--- src/provisioningserver/dhcp/tests/test_config.py 2014-04-01 13:28:39 +0000
16+++ src/provisioningserver/dhcp/tests/test_config.py 2014-04-11 05:22:42 +0000
17@@ -101,6 +101,15 @@
18 template.substitute(params),
19 config.get_config(**params))
20
21+ def test_quotes_interface(self):
22+ # The interface name doesn't normally need to be quoted, but the
23+ # template does quote it, in case it contains dots or other weird
24+ # but legal characters (bug 1306335).
25+ params = make_sample_params()
26+ self.assertIn(
27+ 'interface "%s";' % params['dhcp_subnets'][0]['interface'],
28+ config.get_config(**params))
29+
30 def test_get_config_with_too_few_parameters(self):
31 template = self.patch_template()
32 params = make_sample_params()

Subscribers

People subscribed via source and target branches

to all changes: