Merge lp:~blake-rouse/maas/external-dhcp-api-and-ui into lp:~maas-committers/maas/trunk

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 4877
Proposed branch: lp:~blake-rouse/maas/external-dhcp-api-and-ui
Merge into: lp:~maas-committers/maas/trunk
Prerequisite: lp:~blake-rouse/maas/external-dhcp-model
Diff against target: 135 lines (+53/-6)
6 files modified
src/maasserver/api/vlans.py (+1/-0)
src/maasserver/migrations/builtin/maasserver/0049_add_external_dhcp_present_to_vlan.py (+2/-4)
src/maasserver/migrations/builtin/maasserver/0050_modify_external_dhcp_on_vlan.py (+40/-0)
src/maasserver/models/vlan.py (+3/-1)
src/maasserver/static/partials/vlan-details.html (+6/-0)
src/maasserver/websockets/handlers/tests/test_vlan.py (+1/-1)
To merge this branch: bzr merge lp:~blake-rouse/maas/external-dhcp-api-and-ui
Reviewer Review Type Date Requested Status
LaMont Jones (community) Approve
Review via email: mp+291029@code.launchpad.net

Commit message

Show external_dhcp over the API and on the VLAN details page. Allow saving the IP address of the external DHCP instead of whether it is present or not.

To post a comment you must log in.
Revision history for this message
LaMont Jones (lamont) wrote :

lgtm

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

The attempt to merge lp:~blake-rouse/maas/external-dhcp-api-and-ui into lp:maas failed. Below is the output from the failed tests.

Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    --no-install-recommends install apache2 archdetect-deb authbind bash bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools git gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm postgresql pxelinux python3-all python3-apt python3-bson python3-convoy python3-coverage python3-crochet python3-cssselect python3-curtin python3-dev python3-distro-info python3-django python3-django-nose python3-django-piston3 python3-dnspython python3-docutils python3-formencode python3-hivex python3-httplib2 python3-jinja2 python3-jsonschema python3-lxml python3-mock python3-netaddr python3-netifaces python3-oauth python3-oauthlib python3-openssl python3-paramiko python3-petname python3-pexpect python3-psycopg2 python3-pyinotify python3-pyparsing python3-pyvmomi python3-requests python3-seamicroclient python3-setuptools python3-simplestreams python3-sphinx python3-tempita python3-twisted python3-txtftp python3-tz python3-yaml python3-zope.interface python-bson python-crochet python-django python-django-piston python-djorm-ext-pgarray python-formencode python-lxml python-netaddr python-netifaces python-pocket-lint python-psycopg2 python-tempita python-twisted python-yaml socat syslinux-common tgt ubuntu-cloudimage-keyring wget xvfb
Reading package lists...
Building dependency tree...
Reading state information...
apache2 is already the newest version (2.4.18-1ubuntu1).
archdetect-deb is already the newest version (1.117ubuntu1).
authbind is already the newest version (2.1.1+nmu1).
bash is already the newest version (4.3-14ubuntu1).
bind9 is already the newest version (1:9.10.3.dfsg.P4-5).
bind9utils is already the newest version (1:9.10.3.dfsg.P4-5).
build-essential is already the newest version (12.1ubuntu2).
curl is already the newest version (7.47.0-1ubuntu2).
debhelper is already the newest version (9.20160115ubuntu3).
dh-apport is already the newest version (2.20.1-0ubuntu1).
dh-systemd is already the newest version (1.29ubuntu1).
distro-info is already the newest version (0.14build1).
dnsutils is already the newest version (1:9.10.3.dfsg.P4-5).
firefox is already the newest version (45.0.1+build1-0ubuntu1).
freeipmi-tools is already the newest version (1.4.11-1ubuntu1).
git is already the newest version (1:2.7.4-0ubuntu1).
isc-dhcp-common is already the newest version (4.3.3-5ubuntu11).
libjs-angularjs is already the newest version (1.2.28-1ubuntu2).
libjs-jquery is already the newest version (1.11.3+dfsg-4).
libjs-jquery-hotke...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/api/vlans.py'
--- src/maasserver/api/vlans.py 2016-02-17 16:12:30 +0000
+++ src/maasserver/api/vlans.py 2016-04-06 15:06:15 +0000
@@ -25,6 +25,7 @@
25 'primary_rack',25 'primary_rack',
26 'secondary_rack',26 'secondary_rack',
27 'dhcp_on',27 'dhcp_on',
28 'external_dhcp',
28)29)
2930
3031
3132
=== modified file 'src/maasserver/migrations/builtin/maasserver/0049_add_external_dhcp_present_to_vlan.py'
--- src/maasserver/migrations/builtin/maasserver/0049_add_external_dhcp_present_to_vlan.py 2016-04-05 19:06:56 +0000
+++ src/maasserver/migrations/builtin/maasserver/0049_add_external_dhcp_present_to_vlan.py 2016-04-06 15:06:15 +0000
@@ -6,8 +6,6 @@
6 models,6 models,
7)7)
8import django.db.models.deletion8import django.db.models.deletion
9import maasserver.models.interface
10import maasserver.models.subnet
119
1210
13class Migration(migrations.Migration):11class Migration(migrations.Migration):
@@ -25,11 +23,11 @@
25 migrations.AlterField(23 migrations.AlterField(
26 model_name='interface',24 model_name='interface',
27 name='vlan',25 name='vlan',
28 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=maasserver.models.interface.get_default_vlan),26 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=0),
29 ),27 ),
30 migrations.AlterField(28 migrations.AlterField(
31 model_name='subnet',29 model_name='subnet',
32 name='vlan',30 name='vlan',
33 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=maasserver.models.subnet.get_default_vlan),31 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=0),
34 ),32 ),
35 ]33 ]
3634
=== added file 'src/maasserver/migrations/builtin/maasserver/0050_modify_external_dhcp_on_vlan.py'
--- src/maasserver/migrations/builtin/maasserver/0050_modify_external_dhcp_on_vlan.py 1970-01-01 00:00:00 +0000
+++ src/maasserver/migrations/builtin/maasserver/0050_modify_external_dhcp_on_vlan.py 2016-04-06 15:06:15 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import (
5 migrations,
6 models,
7)
8import django.db.models.deletion
9import maasserver.fields
10import maasserver.models.interface
11import maasserver.models.subnet
12
13
14class Migration(migrations.Migration):
15
16 dependencies = [
17 ('maasserver', '0049_add_external_dhcp_present_to_vlan'),
18 ]
19
20 operations = [
21 migrations.RemoveField(
22 model_name='vlan',
23 name='external_dhcp_present',
24 ),
25 migrations.AddField(
26 model_name='vlan',
27 name='external_dhcp',
28 field=maasserver.fields.MAASIPAddressField(null=True, editable=False, default=None, blank=True),
29 ),
30 migrations.AlterField(
31 model_name='interface',
32 name='vlan',
33 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=maasserver.models.interface.get_default_vlan),
34 ),
35 migrations.AlterField(
36 model_name='subnet',
37 name='vlan',
38 field=models.ForeignKey(to='maasserver.VLAN', on_delete=django.db.models.deletion.PROTECT, default=maasserver.models.subnet.get_default_vlan),
39 ),
40 ]
041
=== modified file 'src/maasserver/models/vlan.py'
--- src/maasserver/models/vlan.py 2016-04-05 16:36:13 +0000
+++ src/maasserver/models/vlan.py 2016-04-06 15:06:15 +0000
@@ -22,6 +22,7 @@
22)22)
23from django.db.models.query import QuerySet23from django.db.models.query import QuerySet
24from maasserver import DefaultMeta24from maasserver import DefaultMeta
25from maasserver.fields import MAASIPAddressField
25from maasserver.models.cleansave import CleanSave26from maasserver.models.cleansave import CleanSave
26from maasserver.models.fabric import Fabric27from maasserver.models.fabric import Fabric
27from maasserver.models.interface import VLANInterface28from maasserver.models.interface import VLANInterface
@@ -162,7 +163,8 @@
162163
163 dhcp_on = BooleanField(default=False, editable=True)164 dhcp_on = BooleanField(default=False, editable=True)
164165
165 external_dhcp_present = BooleanField(default=False, editable=False)166 external_dhcp = MAASIPAddressField(
167 null=True, editable=False, blank=True, default=None)
166168
167 primary_rack = ForeignKey(169 primary_rack = ForeignKey(
168 'RackController', null=True, blank=True, editable=True,170 'RackController', null=True, blank=True, editable=True,
169171
=== modified file 'src/maasserver/static/partials/vlan-details.html'
--- src/maasserver/static/partials/vlan-details.html 2016-03-28 13:54:47 +0000
+++ src/maasserver/static/partials/vlan-details.html 2016-04-06 15:06:15 +0000
@@ -175,6 +175,12 @@
175 </dl>175 </dl>
176 <dl class="six-col last-col">176 <dl class="six-col last-col">
177 <dt class="two-col">DHCP</dt><dd class="four-col last-col">{$ vlanDetails.vlan.dhcp_on ? "Enabled" : "Disabled" $}</dd>177 <dt class="two-col">DHCP</dt><dd class="four-col last-col">{$ vlanDetails.vlan.dhcp_on ? "Enabled" : "Disabled" $}</dd>
178 <div data-ng-if="vlanDetails.vlan.external_dhcp">
179 <dt class="two-col">External DHCP</dt>
180 <dd class="four-col last-col">{$ vlanDetails.vlan.external_dhcp $}
181 <i class="icon warning tooltip" data-tooltip="Another DHCP server has been discovered on this VLAN. Enabling DHCP is not recommended."></i>
182 </dd>
183 </div>
178 <div class="ng-hide" data-ng-show="vlanDetails.primaryRack">184 <div class="ng-hide" data-ng-show="vlanDetails.primaryRack">
179 <dt class="two-col">Primary controller</dt><dd class="four-col last-col">{$ vlanDetails.primaryRack.hostname $}</dd>185 <dt class="two-col">Primary controller</dt><dd class="four-col last-col">{$ vlanDetails.primaryRack.hostname $}</dd>
180 </div>186 </div>
181187
=== modified file 'src/maasserver/websockets/handlers/tests/test_vlan.py'
--- src/maasserver/websockets/handlers/tests/test_vlan.py 2016-04-05 20:12:59 +0000
+++ src/maasserver/websockets/handlers/tests/test_vlan.py 2016-04-06 15:06:15 +0000
@@ -32,7 +32,7 @@
32 "updated": dehydrate_datetime(vlan.updated),32 "updated": dehydrate_datetime(vlan.updated),
33 "created": dehydrate_datetime(vlan.created),33 "created": dehydrate_datetime(vlan.created),
34 "dhcp_on": vlan.dhcp_on,34 "dhcp_on": vlan.dhcp_on,
35 "external_dhcp_present": vlan.external_dhcp_present,35 "external_dhcp": vlan.external_dhcp,
36 "primary_rack": vlan.primary_rack,36 "primary_rack": vlan.primary_rack,
37 "secondary_rack": vlan.secondary_rack,37 "secondary_rack": vlan.secondary_rack,
38 "subnet_ids": sorted([38 "subnet_ids": sorted([