From c032f4588f30d04b6868456fb557daab7986142a Mon Sep 17 00:00:00 2001 From: Brad Hall Date: Mon, 12 Dec 2011 21:23:47 +0000 Subject: Fix error when subnet doesn't have a cidr set If it isn't set in the subnet just take it from the network_ref. Change-Id: Id9b4a25b369884f4f4d5527b44d1215d3c244d70 --- nova/network/quantum/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index 9b6741e92..3ddbe8479 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -489,8 +489,9 @@ class QuantumManager(manager.FlatManager): # Fill in some of the network fields that we would have # previously gotten from the network table (they'll be # passed to the linux_net functions). - network_ref['cidr'] = subnet['cidr'] - n = IPNetwork(subnet['cidr']) + if subnet['cidr']: + network_ref['cidr'] = subnet['cidr'] + n = IPNetwork(network_ref['cidr']) network_ref['dhcp_server'] = IPAddress(n.first + 1) network_ref['dhcp_start'] = IPAddress(n.first + 2) network_ref['broadcast'] = IPAddress(n.broadcast) -- cgit