Merge lp:~blake-rouse/maas/fix-1572070-1.9 into lp:maas/1.9

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 4562
Proposed branch: lp:~blake-rouse/maas/fix-1572070-1.9
Merge into: lp:maas/1.9
Diff against target: 49 lines (+26/-2)
2 files modified
src/maasserver/forms_interface.py (+7/-2)
src/maasserver/tests/test_forms_interface.py (+19/-0)
To merge this branch: bzr merge lp:~blake-rouse/maas/fix-1572070-1.9
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+292567@code.launchpad.net

Commit message

Allow a devices physical interface to be connected to an untagged VLAN.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Self-approving backport.

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

The attempt to merge lp:~blake-rouse/maas/fix-1572070-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://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Sources [273 kB]
Get:4 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B]
Get:5 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Sources [154 kB]
Get:6 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Sources [5,928 B]
Get:7 http://security.ubuntu.com trusty-security/main Sources [112 kB]
Get:8 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [755 kB]
Get:9 http://security.ubuntu.com trusty-security/universe Sources [35.5 kB]
Get:10 http://security.ubuntu.com trusty-security/main amd64 Packages [458 kB]
Get:11 http://security.ubuntu.com trusty-security/universe amd64 Packages [126 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
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 [359 kB]
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:14 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Get:15 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Translation-en [377 kB]
Get:16 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Translation-en [7,227 B]
Get:17 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B]
Get:18 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Translation-en [188 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-backports/main Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://prodstac...

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

The attempt to merge lp:~blake-rouse/maas/fix-1572070-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 [112 kB]
Get:4 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Sources [273 kB]
Get:5 http://security.ubuntu.com trusty-security/universe Sources [35.5 kB]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [458 kB]
Get:7 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [126 kB]
Get:9 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Sources [154 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Get:10 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Sources [5,928 B]
Get:11 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [755 kB]
Hit http://security.ubuntu.com trusty-security/universe Translation-en
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 [359 kB]
Get:14 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Get:15 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Translation-en [377 kB]
Get:16 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Translation-en [7,227 B]
Get:17 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B]
Get:18 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Translation-en [188 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-backports/main Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://prodstac...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/forms_interface.py'
2--- src/maasserver/forms_interface.py 2016-04-05 14:38:42 +0000
3+++ src/maasserver/forms_interface.py 2016-04-21 18:53:08 +0000
4@@ -199,8 +199,13 @@
5 def clean_vlan(self):
6 new_vlan = self.cleaned_data.get('vlan')
7 if new_vlan and new_vlan.fabric.get_default_vlan() != new_vlan:
8- raise ValidationError(
9- "A physical interface can only belong to an untagged VLAN.")
10+ # A device's physical interface can be connected to a tagged VLAN.
11+ # This is because a container or VM could be bridged on the machine
12+ # to a tagged VLAN interface. See lp:1572070 for details.
13+ if self.node.installable:
14+ raise ValidationError(
15+ "A physical interface can only belong to an "
16+ "untagged VLAN.")
17 return new_vlan
18
19 def clean(self):
20
21=== modified file 'src/maasserver/tests/test_forms_interface.py'
22--- src/maasserver/tests/test_forms_interface.py 2016-04-05 15:59:30 +0000
23+++ src/maasserver/tests/test_forms_interface.py 2016-04-21 18:53:08 +0000
24@@ -170,6 +170,25 @@
25 "A physical interface can only belong to an untagged VLAN.",
26 form.errors['vlan'][0])
27
28+ def test_allows_interface_on_tagged_vlan_for_device(self):
29+ device = factory.make_Device()
30+ fabric = factory.make_Fabric()
31+ interface = factory.make_Interface(
32+ INTERFACE_TYPE.PHYSICAL,
33+ node=device, vlan=fabric.get_default_vlan())
34+ vlan = factory.make_VLAN(fabric=fabric)
35+ mac_address = factory.make_mac_address()
36+ form = PhysicalInterfaceForm(
37+ node=device,
38+ data={
39+ 'name': factory.make_name("eth"),
40+ 'mac_address': mac_address,
41+ 'vlan': vlan.id,
42+ })
43+ self.assertTrue(form.is_valid(), form.errors)
44+ interface = form.save()
45+ self.assertEquals(vlan, interface.vlan)
46+
47 def test__rejects_parents(self):
48 parent = factory.make_Interface(INTERFACE_TYPE.PHYSICAL)
49 fabric = factory.make_Fabric()

Subscribers

People subscribed via source and target branches