Merge lp:~blake-rouse/maas/fix-1511690 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: 4451
Proposed branch: lp:~blake-rouse/maas/fix-1511690
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 59 lines (+5/-8)
3 files modified
src/maasserver/migrations/0187_link_missing_subnets.py (+3/-2)
src/maasserver/models/tests/test_fannetwork.py (+1/-1)
src/maasserver/websockets/tests/test_listener.py (+1/-5)
To merge this branch: bzr merge lp:~blake-rouse/maas/fix-1511690
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+276459@code.launchpad.net

Commit message

Fix the assignment of the subnet on the static IP address migration. Fix the random tests failures from the last branch I landed.

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

Self-approving, minor fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/migrations/0187_link_missing_subnets.py'
2--- src/maasserver/migrations/0187_link_missing_subnets.py 2015-11-02 16:34:49 +0000
3+++ src/maasserver/migrations/0187_link_missing_subnets.py 2015-11-02 20:32:03 +0000
4@@ -14,8 +14,9 @@
5 assert hasattr(Subnet.objects, "get_best_subnet_for_ip")
6 for sip in orm['maasserver.StaticIPAddress'].objects.all():
7 if sip.ip is not None and sip.ip != "" and sip.subnet is None:
8- sip.subnet = Subnet.objects.get_best_subnet_for_ip(sip.ip)
9- if sip.subnet != None:
10+ subnet = Subnet.objects.get_best_subnet_for_ip(sip.ip)
11+ if subnet != None:
12+ sip.subnet_id = subnet.id
13 sip.save()
14
15 def backwards(self, orm):
16
17=== modified file 'src/maasserver/models/tests/test_fannetwork.py'
18--- src/maasserver/models/tests/test_fannetwork.py 2015-09-21 20:29:36 +0000
19+++ src/maasserver/models/tests/test_fannetwork.py 2015-11-02 20:32:03 +0000
20@@ -107,7 +107,7 @@
21 underlay="10.0.0.0/8", overlay="10.0.1.0/24")
22
23 def test_stores_host_reserve(self):
24- host_reserve = random.randint(0, 200)
25+ host_reserve = random.randint(1, 200)
26 fannetwork = factory.make_FanNetwork(
27 underlay=factory.make_ipv4_network(slash=16),
28 overlay=factory.make_ipv4_network(slash=8),
29
30=== modified file 'src/maasserver/websockets/tests/test_listener.py'
31--- src/maasserver/websockets/tests/test_listener.py 2015-10-30 11:03:18 +0000
32+++ src/maasserver/websockets/tests/test_listener.py 2015-11-02 20:32:03 +0000
33@@ -17,7 +17,6 @@
34 from collections import namedtuple
35 import errno
36 import random
37-from unittest import skip
38
39 from crochet import wait_for_reactor
40 from django.contrib.auth.models import User
41@@ -1287,9 +1286,6 @@
42 }),
43 )
44
45- @skip(
46- "XXX: GavinPanella 2015-10-30 bug=1511690: This test keeps failing "
47- "when landing unrelated branches, so has been disabled.")
48 @wait_for_reactor
49 @inlineCallbacks
50 def test__calls_handler_with_update_on_create(self):
51@@ -2909,7 +2905,7 @@
52
53 scenarios = (
54 ('node', {
55- 'params': {'installable': True},
56+ 'params': {'installable': True, 'with_boot_disk': True},
57 'listener': 'node',
58 }),
59 )