summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-07-13 12:51:29 +0000
committerTarmac <>2011-07-13 12:51:29 +0000
commitb58e853038e9c322be765600e225568689e5c479 (patch)
tree562f8c6b6b1e66eb18091669179c45746f965a71
parent29ef49c205bf5d042e52a44dda8f16aca043b31c (diff)
parentf794139e6ad70949bdaf26417989f3940e8af3b7 (diff)
Don't pop 'vpn' on kwargs inside a loop in RPCAllocateFixedIP._allocate_fixed_ips (fixes KeyError).
Update allocate_fixed_ip methods in network manager to accept correct kwargs. (fixes regression in bzr 1266)
-rw-r--r--Authors1
-rw-r--r--nova/network/manager.py10
2 files changed, 6 insertions, 5 deletions
diff --git a/Authors b/Authors
index 4aa65eea2..2e50cfbe0 100644
--- a/Authors
+++ b/Authors
@@ -65,6 +65,7 @@ Masanori Itoh <itoumsn@nttdata.co.jp>
Matt Dietz <matt.dietz@rackspace.com>
Michael Gundlach <michael.gundlach@rackspace.com>
Mike Scherbakov <mihgen@gmail.com>
+Mohammed Naser <mnaser@vexxhost.com>
Monsyne Dragon <mdragon@rackspace.com>
Monty Taylor <mordred@inaugust.com>
MORITA Kazutaka <morita.kazutaka@gmail.com>
diff --git a/nova/network/manager.py b/nova/network/manager.py
index f17c86524..824e8d24d 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -128,6 +128,7 @@ class RPCAllocateFixedIP(object):
"""Calls allocate_fixed_ip once for each network."""
green_pool = greenpool.GreenPool()
+ vpn = kwargs.pop('vpn')
for network in networks:
if network['host'] != self.host:
# need to call allocate_fixed_ip to correct network host
@@ -136,15 +137,14 @@ class RPCAllocateFixedIP(object):
args = {}
args['instance_id'] = instance_id
args['network_id'] = network['id']
- args['vpn'] = kwargs.pop('vpn')
+ args['vpn'] = vpn
green_pool.spawn_n(rpc.call, context, topic,
{'method': '_rpc_allocate_fixed_ip',
'args': args})
else:
# i am the correct host, run here
- self.allocate_fixed_ip(context, instance_id, network,
- vpn=kwargs.pop('vpn'))
+ self.allocate_fixed_ip(context, instance_id, network, vpn=vpn)
# wait for all of the allocates (if any) to finish
green_pool.waitall()
@@ -706,7 +706,7 @@ class FlatManager(NetworkManager):
timeout_fixed_ips = False
- def _allocate_fixed_ips(self, context, instance_id, networks):
+ def _allocate_fixed_ips(self, context, instance_id, networks, **kwargs):
"""Calls allocate_fixed_ip once for each network."""
for network in networks:
self.allocate_fixed_ip(context, instance_id, network)
@@ -763,7 +763,7 @@ class FlatDHCPManager(FloatingIP, RPCAllocateFixedIP, NetworkManager):
self.driver.ensure_bridge(network['bridge'],
network['bridge_interface'])
- def allocate_fixed_ip(self, context, instance_id, network):
+ def allocate_fixed_ip(self, context, instance_id, network, **kwargs):
"""Allocate flat_network fixed_ip, then setup dhcp for this network."""
address = super(FlatDHCPManager, self).allocate_fixed_ip(context,
instance_id,