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
=== modified file 'src/maasserver/migrations/0187_link_missing_subnets.py'
--- src/maasserver/migrations/0187_link_missing_subnets.py 2015-11-02 16:34:49 +0000
+++ src/maasserver/migrations/0187_link_missing_subnets.py 2015-11-02 20:32:03 +0000
@@ -14,8 +14,9 @@
14 assert hasattr(Subnet.objects, "get_best_subnet_for_ip")14 assert hasattr(Subnet.objects, "get_best_subnet_for_ip")
15 for sip in orm['maasserver.StaticIPAddress'].objects.all():15 for sip in orm['maasserver.StaticIPAddress'].objects.all():
16 if sip.ip is not None and sip.ip != "" and sip.subnet is None:16 if sip.ip is not None and sip.ip != "" and sip.subnet is None:
17 sip.subnet = Subnet.objects.get_best_subnet_for_ip(sip.ip)17 subnet = Subnet.objects.get_best_subnet_for_ip(sip.ip)
18 if sip.subnet != None:18 if subnet != None:
19 sip.subnet_id = subnet.id
19 sip.save()20 sip.save()
2021
21 def backwards(self, orm):22 def backwards(self, orm):
2223
=== modified file 'src/maasserver/models/tests/test_fannetwork.py'
--- src/maasserver/models/tests/test_fannetwork.py 2015-09-21 20:29:36 +0000
+++ src/maasserver/models/tests/test_fannetwork.py 2015-11-02 20:32:03 +0000
@@ -107,7 +107,7 @@
107 underlay="10.0.0.0/8", overlay="10.0.1.0/24")107 underlay="10.0.0.0/8", overlay="10.0.1.0/24")
108108
109 def test_stores_host_reserve(self):109 def test_stores_host_reserve(self):
110 host_reserve = random.randint(0, 200)110 host_reserve = random.randint(1, 200)
111 fannetwork = factory.make_FanNetwork(111 fannetwork = factory.make_FanNetwork(
112 underlay=factory.make_ipv4_network(slash=16),112 underlay=factory.make_ipv4_network(slash=16),
113 overlay=factory.make_ipv4_network(slash=8),113 overlay=factory.make_ipv4_network(slash=8),
114114
=== modified file 'src/maasserver/websockets/tests/test_listener.py'
--- src/maasserver/websockets/tests/test_listener.py 2015-10-30 11:03:18 +0000
+++ src/maasserver/websockets/tests/test_listener.py 2015-11-02 20:32:03 +0000
@@ -17,7 +17,6 @@
17from collections import namedtuple17from collections import namedtuple
18import errno18import errno
19import random19import random
20from unittest import skip
2120
22from crochet import wait_for_reactor21from crochet import wait_for_reactor
23from django.contrib.auth.models import User22from django.contrib.auth.models import User
@@ -1287,9 +1286,6 @@
1287 }),1286 }),
1288 )1287 )
12891288
1290 @skip(
1291 "XXX: GavinPanella 2015-10-30 bug=1511690: This test keeps failing "
1292 "when landing unrelated branches, so has been disabled.")
1293 @wait_for_reactor1289 @wait_for_reactor
1294 @inlineCallbacks1290 @inlineCallbacks
1295 def test__calls_handler_with_update_on_create(self):1291 def test__calls_handler_with_update_on_create(self):
@@ -2909,7 +2905,7 @@
29092905
2910 scenarios = (2906 scenarios = (
2911 ('node', {2907 ('node', {
2912 'params': {'installable': True},2908 'params': {'installable': True, 'with_boot_disk': True},
2913 'listener': 'node',2909 'listener': 'node',
2914 }),2910 }),
2915 )2911 )