From 833ac1674d33cde3721b2d10a3d9545cc8320b37 Mon Sep 17 00:00:00 2001 From: Brian Lamar Date: Thu, 1 Sep 2011 16:09:23 -0400 Subject: Added test for NULL network. --- nova/network/manager.py | 4 ++-- nova/tests/test_network.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/nova/network/manager.py b/nova/network/manager.py index d7b0abdda..e8c5c0654 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -484,8 +484,8 @@ class NetworkManager(manager.SchedulerDependentManager): for vif in vifs: network = vif['network'] - if network is None: - continue + #if network is None: + # continue # determine which of the instance's IPs belong to this network network_IPs = [fixed_ip['address'] for fixed_ip in fixed_ips if diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py index 25ff940f0..2ae5a35e3 100644 --- a/nova/tests/test_network.py +++ b/nova/tests/test_network.py @@ -118,9 +118,14 @@ vifs = [{'id': 0, {'id': 1, 'address': 'DE:AD:BE:EF:00:01', 'uuid': '00000000-0000-0000-0000-0000000000000001', - 'network_id': 0, 'network_id': 1, 'network': FakeModel(**networks[1]), + 'instance_id': 0}, + {'id': 2, + 'address': 'DE:AD:BE:EF:00:02', + 'uuid': '00000000-0000-0000-0000-0000000000000002', + 'network_id': 2, + 'network': None, 'instance_id': 0}] -- cgit