Merge lp:~rvb/maas/bug-1415538-1.7 into lp:maas/1.7

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 3343
Proposed branch: lp:~rvb/maas/bug-1415538-1.7
Merge into: lp:maas/1.7
Diff against target: 63 lines (+22/-2)
3 files modified
src/maasserver/dhcp.py (+3/-1)
src/maasserver/tests/test_dhcp.py (+8/-0)
src/provisioningserver/dhcp/tests/test_config.py (+11/-1)
To merge this branch: bzr merge lp:~rvb/maas/bug-1415538-1.7
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+248726@code.launchpad.net

Commit message

Backport 3497: Do not generate the 'option routers' stanza if router IP is None.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Simple backport: self-approving.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (20.2 KiB)

The attempt to merge lp:~rvb/maas/bug-1415538-1.7 into lp:maas/1.7 failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Get:2 http://security.ubuntu.com trusty-security Release [62.0 kB]
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [64.8 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:6 http://security.ubuntu.com trusty-security/universe Sources [17.5 kB]
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [200 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [85.3 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [161 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [99.9 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [412 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [244 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 1,409 kB in 2s (475 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi python-openssl...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/dhcp.py'
2--- src/maasserver/dhcp.py 2014-10-03 19:29:51 +0000
3+++ src/maasserver/dhcp.py 2015-02-05 10:00:03 +0000
4@@ -56,7 +56,9 @@
5 'subnet_cidr': unicode(interface.network.cidr),
6 'broadcast_ip': interface.broadcast_ip,
7 'interface': interface.interface,
8- 'router_ip': unicode(interface.router_ip),
9+ 'router_ip': (
10+ None if not interface.router_ip
11+ else unicode(interface.router_ip)),
12 'dns_servers': dns_servers,
13 'ntp_server': ntp_server,
14 'domain_name': interface.nodegroup.name,
15
16=== modified file 'src/maasserver/tests/test_dhcp.py'
17--- src/maasserver/tests/test_dhcp.py 2014-11-07 13:16:58 +0000
18+++ src/maasserver/tests/test_dhcp.py 2015-02-05 10:00:03 +0000
19@@ -200,6 +200,14 @@
20 self.expectThat(
21 config['ip_range_low'], Not(Equals(interface.static_ip_range_low)))
22
23+ def test__doesnt_convert_None_router_ip(self):
24+ interface = factory.make_NodeGroupInterface(factory.make_NodeGroup())
25+ interface.router_ip = None
26+ interface.save()
27+ config = make_subnet_config(
28+ interface, factory.make_name('dns'), factory.make_name('ntp'))
29+ self.assertEqual(None, config['router_ip'])
30+
31
32 class TestDoConfigureDHCP(MAASServerTestCase):
33 """Tests for `do_configure_dhcp`."""
34
35=== modified file 'src/provisioningserver/dhcp/tests/test_config.py'
36--- src/provisioningserver/dhcp/tests/test_config.py 2014-11-07 15:50:30 +0000
37+++ src/provisioningserver/dhcp/tests/test_config.py 2015-02-05 10:00:03 +0000
38@@ -147,7 +147,7 @@
39 config.get_config('dhcpd.conf.template', **params),
40 Contains(router_ip))
41
42- def test__renders_without_router_ip(self):
43+ def test__renders_with_empty_string_router_ip(self):
44 params = make_sample_params()
45 params['dhcp_subnets'][0]['router_ip'] = ''
46 template = self.patch_template()
47@@ -157,6 +157,16 @@
48 config.get_config('dhcpd.conf.template', **params))
49 self.assertNotIn("routers", rendered)
50
51+ def test__renders_with_None_router_ip(self):
52+ params = make_sample_params()
53+ params['dhcp_subnets'][0]['router_ip'] = None
54+ template = self.patch_template()
55+ rendered = template.substitute(params)
56+ self.assertEqual(
57+ rendered,
58+ config.get_config('dhcpd.conf.template', **params))
59+ self.assertNotIn("routers", rendered)
60+
61
62 class TestComposeConditionalBootloader(PservTestCase):
63 """Tests for `compose_conditional_bootloader`."""

Subscribers

People subscribed via source and target branches

to all changes: