Merge lp:~lamont/maas/bug-1556366 into lp:~maas-committers/maas/trunk

Proposed by LaMont Jones
Status: Merged
Approved by: LaMont Jones
Approved revision: no longer in the source branch.
Merged at revision: 4818
Proposed branch: lp:~lamont/maas/bug-1556366
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 104 lines (+54/-4)
3 files modified
src/maasserver/static/partials/node-details.html (+1/-1)
src/maasserver/websockets/handlers/node.py (+1/-1)
src/maasserver/websockets/handlers/tests/test_machine.py (+52/-2)
To merge this branch: bzr merge lp:~lamont/maas/bug-1556366
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
Jeffrey C Jones (community) Approve
Review via email: mp+289848@code.launchpad.net

Commit message

Correctly indicate the pxeboot interface for a machine on the node-details page of the UI.

Description of the change

Correctly indicate the pxeboot interface for a machine on the node-details page of the UI.

To post a comment you must log in.
Revision history for this message
Jeffrey C Jones (trapnine) wrote :

Line 8/9 LGTM, good catch!

review: Approve
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Hah; good find.

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

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

Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:2 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial InRelease [116 kB]
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
Get:5 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main Sources [1,108 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe Sources [7,509 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,442 kB]
Get:8 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/main Translation-en [732 kB]
Get:9 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,246 kB]
Get:10 http://prodstack-zone-2.clouds.archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,186 kB]
Fetched 22.3 MB in 4s (5,383 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
    --no-install-recommends install apache2 archdetect-deb authbind 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.114ubuntu4).
authbind is already the newest version (2.1.1+nmu1).
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.20160115ubuntu2).
dh-apport is already the newest version (2.20-0ubu...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/partials/node-details.html'
2--- src/maasserver/static/partials/node-details.html 2016-03-16 19:56:46 +0000
3+++ src/maasserver/static/partials/node-details.html 2016-03-22 22:33:53 +0000
4@@ -542,7 +542,7 @@
5 </div>
6 <div class="table__data table-col--3">
7 <input class="align-center" type="radio" name="bootInterface" checked
8- data-ng-if="!isController || isBootInterface(interface)">
9+ data-ng-if="!isController && isBootInterface(interface)">
10 </div>
11 <div class="table__data table-col--9">{$ getInterfaceTypeText(interface) $}</div>
12 <div class="table__data table-col--14">
13
14=== modified file 'src/maasserver/websockets/handlers/node.py'
15--- src/maasserver/websockets/handlers/node.py 2016-03-18 16:55:20 +0000
16+++ src/maasserver/websockets/handlers/node.py 2016-03-22 22:33:53 +0000
17@@ -345,7 +345,7 @@
18 "type": interface.type,
19 "name": interface.get_name(),
20 "enabled": interface.is_enabled(),
21- "is_boot": interface == obj.boot_interface,
22+ "is_boot": interface == obj.get_boot_interface(),
23 "mac_address": "%s" % interface.mac_address,
24 "vlan_id": interface.vlan_id,
25 "parents": [
26
27=== modified file 'src/maasserver/websockets/handlers/tests/test_machine.py'
28--- src/maasserver/websockets/handlers/tests/test_machine.py 2016-03-18 16:55:20 +0000
29+++ src/maasserver/websockets/handlers/tests/test_machine.py 2016-03-22 22:33:53 +0000
30@@ -552,6 +552,56 @@
31 filesystem.fstype in FILESYSTEM_FORMAT_TYPE_CHOICES_DICT),
32 }, handler.dehydrate_filesystem(filesystem))
33
34+ def test_dehydrate_interface_for_multinic_node(self):
35+ owner = factory.make_User()
36+ node = factory.make_Node(owner=owner, status=NODE_STATUS.READY)
37+ handler = MachineHandler(owner, {})
38+ interface = factory.make_Interface(INTERFACE_TYPE.PHYSICAL, node=node)
39+ factory.make_StaticIPAddress(
40+ alloc_type=IPADDRESS_TYPE.AUTO, ip="",
41+ subnet=factory.make_Subnet(), interface=interface)
42+ interface2 = factory.make_Interface(INTERFACE_TYPE.PHYSICAL, node=node)
43+ expected_links = interface.get_links()
44+ for link in expected_links:
45+ link["subnet_id"] = link.pop("subnet").id
46+ self.assertEqual({
47+ "id": interface.id,
48+ "type": interface.type,
49+ "name": interface.get_name(),
50+ "enabled": interface.is_enabled(),
51+ "is_boot": True,
52+ "mac_address": "%s" % interface.mac_address,
53+ "vlan_id": interface.vlan_id,
54+ "parents": [
55+ nic.id
56+ for nic in interface.parents.all()
57+ ],
58+ "children": [
59+ nic.child.id
60+ for nic in interface.children_relationships.all()
61+ ],
62+ "links": expected_links,
63+ }, handler.dehydrate_interface(interface, node))
64+ expected_links = interface2.get_links()
65+ self.assertEqual({
66+ "id": interface2.id,
67+ "type": interface2.type,
68+ "name": interface2.get_name(),
69+ "enabled": interface2.is_enabled(),
70+ "is_boot": False,
71+ "mac_address": "%s" % interface2.mac_address,
72+ "vlan_id": interface2.vlan_id,
73+ "parents": [
74+ nic.id
75+ for nic in interface2.parents.all()
76+ ],
77+ "children": [
78+ nic.child.id
79+ for nic in interface2.children_relationships.all()
80+ ],
81+ "links": expected_links,
82+ }, handler.dehydrate_interface(interface2, node))
83+
84 def test_dehydrate_interface_for_ready_node(self):
85 owner = factory.make_User()
86 node = factory.make_Node(owner=owner, status=NODE_STATUS.READY)
87@@ -568,7 +618,7 @@
88 "type": interface.type,
89 "name": interface.get_name(),
90 "enabled": interface.is_enabled(),
91- "is_boot": interface == node.boot_interface,
92+ "is_boot": interface == node.get_boot_interface(),
93 "mac_address": "%s" % interface.mac_address,
94 "vlan_id": interface.vlan_id,
95 "parents": [
96@@ -606,7 +656,7 @@
97 "type": interface.type,
98 "name": interface.get_name(),
99 "enabled": interface.is_enabled(),
100- "is_boot": interface == node.boot_interface,
101+ "is_boot": interface == node.get_boot_interface(),
102 "mac_address": "%s" % interface.mac_address,
103 "vlan_id": interface.vlan_id,
104 "parents": [