From 0743313b521e3a7f2528d774ecf117ce03ec60d5 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 23 Jul 2012 14:16:26 +0100 Subject: Make it clear subnet_bits is unused in ipam case In NetworkManager.create_networks(), the subnet_bits variable is unused where 'ipam' is passed as a parameter - i.e. when the method is called from QuantumNovaIPAMLib. This is because in the ipam case we never carve up the IP range into multiple networks. Move the variable around so that its usage scope is more obvious. Change-Id: I2a1a2cb63f9864c15b33b30f1bf995a50a6ec067 --- nova/network/manager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nova/network/manager.py b/nova/network/manager.py index c0fb2312b..f604d156d 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -1342,14 +1342,13 @@ class NetworkManager(manager.SchedulerDependentManager): subnets_v4 = [] subnets_v6 = [] - subnet_bits = int(math.ceil(math.log(network_size, 2))) - if kwargs.get('ipam'): if cidr_v6: subnets_v6 = [netaddr.IPNetwork(cidr_v6)] if cidr: subnets_v4 = [netaddr.IPNetwork(cidr)] else: + subnet_bits = int(math.ceil(math.log(network_size, 2))) if cidr_v6: fixed_net_v6 = netaddr.IPNetwork(cidr_v6) prefixlen_v6 = 128 - subnet_bits -- cgit