Merge lp:~mpontillo/maas/dhcp-with-aliases--bug-1600267--1.9 into lp:maas/1.9

Proposed by Mike Pontillo on 2016-07-11
Status: Merged
Approved by: Mike Pontillo on 2016-07-12
Approved revision: 4591
Merged at revision: 4591
Proposed branch: lp:~mpontillo/maas/dhcp-with-aliases--bug-1600267--1.9
Merge into: lp:maas/1.9
Diff against target: 87 lines (+16/-11)
2 files modified
src/maasserver/static/js/angular/controllers/node_details_networking.js (+8/-7)
src/maasserver/static/js/angular/controllers/tests/test_node_details_networking.js (+8/-4)
To merge this branch: bzr merge lp:~mpontillo/maas/dhcp-with-aliases--bug-1600267--1.9
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve on 2016-07-11
Review via email: mp+299739@code.launchpad.net

Commit message

Backport revision 5166 from trunk to fix adding aliases to interfaces where DHCP is enabled.

To post a comment you must log in.
Mike Pontillo (mpontillo) wrote :

Self-approved backport.

review: Approve
MAAS Lander (maas-lander) wrote :
Download full text (1.3 MiB)

The attempt to merge lp:~mpontillo/maas/dhcp-with-aliases--bug-1600267--1.9 into lp:maas/1.9 failed. Below is the output from the failed tests.

Ign http://prodstack-zone-1.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Get:2 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports InRelease
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release
Get:3 http://security.ubuntu.com trusty-security/main Sources [118 kB]
Get:4 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Sources [278 kB]
Get:5 http://security.ubuntu.com trusty-security/universe Sources [38.0 kB]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [502 kB]
Get:7 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B]
Get:8 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Sources [158 kB]
Get:9 http://security.ubuntu.com trusty-security/universe amd64 Packages [130 kB]
Get:10 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Sources [5,936 B]
Get:11 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [790 kB]
Get:12 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:13 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [363 kB]
Get:14 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty/multiverse amd64 Packages
Fetched 2,549 kB in 1s (1,319 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive ...

Mike Pontillo (mpontillo) wrote :

Will need to reset the 1.9 lander before attempting again; looks like there may be some stale processes interfering with the tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/js/angular/controllers/node_details_networking.js'
2--- src/maasserver/static/js/angular/controllers/node_details_networking.js 2016-06-14 06:41:30 +0000
3+++ src/maasserver/static/js/angular/controllers/node_details_networking.js 2016-07-11 20:34:47 +0000
4@@ -98,15 +98,17 @@
5 }
6 });
7 } else {
8- // Don't add LINK_UP or DHCP if more than one link exists or
9+ // Don't add LINK_UP if more than one link exists or
10 // if the interface is an alias.
11- var allowLinkUpAndDHCP = (
12+ var allowLinkUp = (
13 (angular.isObject(nic.links) && nic.links.length > 1) ||
14 (nic.type === "alias"));
15 angular.forEach(modes, function(mode) {
16- if(allowLinkUpAndDHCP && (
17- mode.mode === "link_up" ||
18- mode.mode === "dhcp")) {
19+ if(allowLinkUp && mode.mode === "link_up") {
20+ return;
21+ }
22+ // Can't run DHCP twice on one NIC.
23+ if(nic.type === "alias" && mode.mode === "dhcp") {
24 return;
25 }
26 filtered.push(mode);
27@@ -808,8 +810,7 @@
28 } else if(nic.type === INTERFACE_TYPE.ALIAS) {
29 return false;
30 } else if(nic.links.length === 0 ||
31- nic.links[0].mode === LINK_MODE.LINK_UP ||
32- nic.links[0].mode === LINK_MODE.DHCP) {
33+ nic.links[0].mode === LINK_MODE.LINK_UP) {
34 return false;
35 } else {
36 return true;
37
38=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_node_details_networking.js'
39--- src/maasserver/static/js/angular/controllers/tests/test_node_details_networking.js 2016-06-14 07:17:48 +0000
40+++ src/maasserver/static/js/angular/controllers/tests/test_node_details_networking.js 2016-07-11 20:34:47 +0000
41@@ -238,7 +238,7 @@
42 ]);
43 });
44
45- it("auto and static modes if more than one link", function() {
46+ it("auto, static, and dhcp modes if more than one link", function() {
47 var nic = {
48 subnet : {},
49 links: [{}, {}]
50@@ -251,6 +251,10 @@
51 {
52 "mode": "static",
53 "text": "Static assign"
54+ },
55+ {
56+ "mode": "dhcp",
57+ "text": "DHCP"
58 }
59 ]);
60 });
61@@ -788,7 +792,7 @@
62 it("updates newInterface.parent object", function() {
63 var controller = makeController();
64 var newInterface = {
65- type: "vlan"
66+ type: "alias"
67 };
68 setupNewInterface(controller, newInterface);
69 var parent = newInterface.parent;
70@@ -1960,7 +1964,7 @@
71 expect($scope.canAddAlias(nic)).toBe(false);
72 });
73
74- it("returns false if nic has dhcp", function() {
75+ it("returns true if nic has dhcp", function() {
76 var controller = makeController();
77 var nic = {
78 type: "physical",
79@@ -1968,7 +1972,7 @@
80 mode: "dhcp"
81 }]
82 };
83- expect($scope.canAddAlias(nic)).toBe(false);
84+ expect($scope.canAddAlias(nic)).toBe(true);
85 });
86
87 it("returns true if nic has static", function() {

Subscribers

People subscribed via source and target branches