summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Hall <brad@nicira.com>2011-12-12 21:23:47 +0000
committerBrad Hall <brad@nicira.com>2011-12-12 21:28:23 +0000
commitc032f4588f30d04b6868456fb557daab7986142a (patch)
tree6886c6063fd1760b19832f7b2127d66c3eb6f030
parentb4a2d19aeab547cf1e917beef49ca24019389243 (diff)
downloadnova-c032f4588f30d04b6868456fb557daab7986142a.tar.gz
nova-c032f4588f30d04b6868456fb557daab7986142a.tar.xz
nova-c032f4588f30d04b6868456fb557daab7986142a.zip
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
-rw-r--r--nova/network/quantum/manager.py5
1 files 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)